From bd84992c84d0d6254d47e4632d9d576155bb5cde Mon Sep 17 00:00:00 2001 From: Philipp Fruck Date: Mon, 22 Apr 2024 14:26:16 +0200 Subject: [PATCH 1/3] chore: Update generator to v7.5.0 --- custom/build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom/build.sh b/custom/build.sh index 381d98f..49dd91f 100755 --- a/custom/build.sh +++ b/custom/build.sh @@ -8,7 +8,7 @@ set -e git_user_id=p-fruck git_repo_id=python-contabo proj_dir="$(readlink -f $(dirname $0))/.." # root directory of the project -generator_version=v6.1.0 # version of the openapi-generator-cli +generator_version=v7.5.0 # version of the openapi-generator-cli function customize_readme() { mv README.md README.md.gen @@ -24,7 +24,7 @@ function customize_readme() { # by default, the Contabo API documentation is set as package description for the PyPI package. # Instead, the GitHub README should be defined as description. function customize_pypi_description() { - line_no=$(grep -n 'long_description' setup.py | cut -d ':' -f 1) + line_no=$(grep -n 'long_description=' setup.py | cut -d ':' -f 1) head -n ${line_no} setup.py > setup.py.new # add README content with absolute links to GitHub repo @@ -33,7 +33,6 @@ function customize_pypi_description() { # add additional metadata cat << EOF >> setup.py.new """, - long_description_content_type='text/markdown', project_urls={ "Bug Tracker": "https://github.com/${git_user_id}/${git_repo_id}/issues", }, From da9d9b99231a8abe9a949901e62ff4f67f22dd78 Mon Sep 17 00:00:00 2001 From: Philipp Fruck Date: Mon, 22 Apr 2024 14:29:39 +0200 Subject: [PATCH 2/3] chore: Apply new generator version --- .github/workflows/python.yml | 38 + .gitlab-ci.yml | 27 +- .openapi-generator/FILES | 780 +-- .openapi-generator/VERSION | 2 +- .travis.yml | 6 +- README.md | 124 +- docs/AddOnQuantityRequest.md | 19 +- docs/AddOnRequest.md | 19 +- docs/AddOnResponse.md | 19 +- docs/AdditionalIp.md | 19 +- docs/ApiPermissionsResponse.md | 21 +- docs/ApplicationConfig.md | 19 +- docs/ApplicationRequirements.md | 23 +- docs/ApplicationResponse.md | 23 +- docs/AssignInstancePrivateNetworkResponse.md | 21 +- docs/AssignedTagResponse.md | 19 +- docs/AssignmentAuditResponse.md | 21 +- docs/AssignmentResponse.md | 19 +- docs/AutoScalingTypeRequest.md | 19 +- docs/AutoScalingTypeResponse.md | 19 +- docs/CancelInstanceResponse.md | 23 +- docs/CancelInstanceResponseData.md | 19 +- docs/CancelObjectStorageResponse.md | 23 +- docs/CancelObjectStorageResponseData.md | 19 +- docs/ClientResponse.md | 19 +- docs/ClientSecretResponse.md | 19 +- docs/CreateAssignmentResponse.md | 21 +- docs/CreateCustomImageFailResponse.md | 19 +- docs/CreateCustomImageRequest.md | 21 +- docs/CreateCustomImageResponse.md | 23 +- docs/CreateCustomImageResponseData.md | 19 +- docs/CreateInstanceAddons.md | 29 +- docs/CreateInstanceRequest.md | 33 +- docs/CreateInstanceResponse.md | 23 +- docs/CreateInstanceResponseData.md | 23 +- docs/CreateObjectStorageRequest.md | 23 +- docs/CreateObjectStorageResponse.md | 23 +- docs/CreateObjectStorageResponseData.md | 21 +- docs/CreatePrivateNetworkRequest.md | 21 +- docs/CreatePrivateNetworkResponse.md | 23 +- docs/CreateRoleRequest.md | 21 +- docs/CreateRoleResponse.md | 23 +- docs/CreateRoleResponseData.md | 19 +- docs/CreateSecretRequest.md | 19 +- docs/CreateSecretResponse.md | 23 +- docs/CreateSnapshotRequest.md | 19 +- docs/CreateSnapshotResponse.md | 23 +- docs/CreateTagRequest.md | 21 +- docs/CreateTagResponse.md | 23 +- docs/CreateTagResponseData.md | 19 +- docs/CreateTicketRequest.md | 19 +- docs/CreateTicketResponse.md | 23 +- docs/CreateTicketResponseData.md | 19 +- docs/CreateUserRequest.md | 25 +- docs/CreateUserResponse.md | 23 +- docs/CreateUserResponseData.md | 19 +- docs/CredentialData.md | 19 +- docs/CustomImagesStatsResponse.md | 23 +- docs/CustomImagesStatsResponseData.md | 19 +- docs/DataCenterResponse.md | 21 +- docs/ExtraStorageRequest.md | 23 +- docs/FindAssignmentResponse.md | 23 +- docs/FindClientResponse.md | 23 +- docs/FindCredentialResponse.md | 23 +- docs/FindImageResponse.md | 23 +- docs/FindInstanceResponse.md | 23 +- docs/FindObjectStorageResponse.md | 23 +- docs/FindPrivateNetworkResponse.md | 23 +- docs/FindRoleResponse.md | 23 +- docs/FindSecretResponse.md | 23 +- docs/FindSnapshotResponse.md | 23 +- docs/FindTagResponse.md | 23 +- docs/FindUserIsPasswordSetResponse.md | 23 +- docs/FindUserResponse.md | 23 +- docs/FindVncResponse.md | 23 +- docs/FirewallingUpgradeRequest.md | 21 +- docs/GenerateClientSecretResponse.md | 23 +- docs/ImageAuditResponse.md | 25 +- docs/ImageAuditResponseData.md | 21 +- docs/ImageResponse.md | 19 +- docs/ImagesApi.md | 264 +- docs/ImagesAuditsApi.md | 66 +- docs/InstanceActionsApi.md | 272 +- docs/InstanceActionsAuditsApi.md | 64 +- docs/InstanceAssignmentSelfLinks.md | 21 +- docs/InstanceRescueActionResponse.md | 23 +- docs/InstanceRescueActionResponseData.md | 19 +- docs/InstanceResetPasswordActionResponse.md | 23 +- ...InstanceResetPasswordActionResponseData.md | 19 +- docs/InstanceResponse.md | 27 +- docs/InstanceRestartActionResponse.md | 23 +- docs/InstanceRestartActionResponseData.md | 19 +- docs/InstanceShutdownActionResponse.md | 23 +- docs/InstanceShutdownActionResponseData.md | 19 +- docs/InstanceStartActionResponse.md | 23 +- docs/InstanceStartActionResponseData.md | 19 +- docs/InstanceStatus.md | 2 +- docs/InstanceStopActionResponse.md | 23 +- docs/InstanceStopActionResponseData.md | 19 +- docs/Instances.md | 19 +- docs/InstancesActionsAuditResponse.md | 21 +- docs/InstancesActionsRescueRequest.md | 21 +- docs/InstancesApi.md | 370 +- docs/InstancesAuditResponse.md | 21 +- docs/InstancesAuditsApi.md | 64 +- docs/InstancesResetPasswordActionsRequest.md | 21 +- docs/InternalApi.md | 86 +- docs/IpConfig.md | 19 +- docs/IpV4.md | 19 +- docs/IpV6.md | 19 +- docs/Links.md | 23 +- docs/ListApiPermissionResponse.md | 23 +- docs/ListApplicationsResponse.md | 25 +- docs/ListAssignmentAuditsResponse.md | 25 +- docs/ListAssignmentResponse.md | 25 +- docs/ListCredentialResponse.md | 25 +- docs/ListDataCenterResponse.md | 25 +- docs/ListImageResponse.md | 25 +- docs/ListImageResponseData.md | 21 +- docs/ListInstancesActionsAuditResponse.md | 25 +- docs/ListInstancesAuditResponse.md | 25 +- docs/ListInstancesResponse.md | 25 +- docs/ListInstancesResponseData.md | 27 +- docs/ListObjectStorageAuditResponse.md | 25 +- docs/ListObjectStorageResponse.md | 25 +- docs/ListPrivateNetworkAuditResponse.md | 25 +- docs/ListPrivateNetworkResponse.md | 25 +- docs/ListPrivateNetworkResponseData.md | 21 +- docs/ListRoleAuditResponse.md | 23 +- docs/ListRoleResponse.md | 25 +- docs/ListSecretAuditResponse.md | 25 +- docs/ListSecretResponse.md | 25 +- docs/ListSnapshotResponse.md | 25 +- docs/ListSnapshotsAuditResponse.md | 25 +- docs/ListTagAuditsResponse.md | 25 +- docs/ListTagResponse.md | 25 +- docs/ListUserAuditResponse.md | 25 +- docs/ListUserResponse.md | 25 +- docs/MinimumRequirements.md | 19 +- docs/ObjectStorageAuditResponse.md | 21 +- docs/ObjectStorageResponse.md | 21 +- docs/ObjectStoragesApi.md | 388 +- docs/ObjectStoragesAuditsApi.md | 66 +- docs/ObjectStoragesStatsResponse.md | 23 +- docs/ObjectStoragesStatsResponseData.md | 19 +- docs/OptimalRequirements.md | 19 +- docs/PaginationMeta.md | 19 +- docs/PatchInstanceRequest.md | 19 +- docs/PatchInstanceResponse.md | 23 +- docs/PatchInstanceResponseData.md | 19 +- docs/PatchObjectStorageRequest.md | 19 +- docs/PatchPrivateNetworkRequest.md | 19 +- docs/PatchPrivateNetworkResponse.md | 23 +- docs/PatchVncRequest.md | 19 +- docs/PermissionRequest.md | 23 +- docs/PermissionResponse.md | 23 +- docs/PrivateIpConfig.md | 21 +- docs/PrivateNetworkAuditResponse.md | 21 +- docs/PrivateNetworkResponse.md | 21 +- docs/PrivateNetworksApi.md | 307 +- docs/PrivateNetworksAuditsApi.md | 64 +- docs/ReinstallInstanceRequest.md | 23 +- docs/ReinstallInstanceResponse.md | 23 +- docs/ReinstallInstanceResponseData.md | 19 +- docs/ResourcePermissionsResponse.md | 19 +- docs/RoleAuditResponse.md | 21 +- docs/RoleResponse.md | 21 +- docs/RolesApi.md | 292 +- docs/RolesAuditsApi.md | 64 +- docs/RollbackSnapshotResponse.md | 21 +- docs/SecretAuditResponse.md | 21 +- docs/SecretResponse.md | 19 +- docs/SecretsApi.md | 219 +- docs/SecretsAuditsApi.md | 64 +- docs/SelfLinks.md | 21 +- docs/SnapshotResponse.md | 19 +- docs/SnapshotsApi.md | 276 +- docs/SnapshotsAuditResponse.md | 21 +- docs/SnapshotsAuditsApi.md | 68 +- docs/TagAssignmentSelfLinks.md | 21 +- docs/TagAssignmentsApi.md | 186 +- docs/TagAssignmentsAuditsApi.md | 68 +- docs/TagAuditResponse.md | 21 +- docs/TagResponse.md | 19 +- docs/TagsApi.md | 214 +- docs/TagsAuditsApi.md | 64 +- .../UnassignInstancePrivateNetworkResponse.md | 21 +- docs/UpdateCustomImageRequest.md | 19 +- docs/UpdateCustomImageResponse.md | 23 +- docs/UpdateCustomImageResponseData.md | 19 +- docs/UpdateRoleRequest.md | 21 +- docs/UpdateRoleResponse.md | 21 +- docs/UpdateSecretRequest.md | 19 +- docs/UpdateSecretResponse.md | 21 +- docs/UpdateSnapshotRequest.md | 19 +- docs/UpdateSnapshotResponse.md | 23 +- docs/UpdateTagRequest.md | 19 +- docs/UpdateTagResponse.md | 21 +- docs/UpdateUserRequest.md | 21 +- docs/UpdateUserResponse.md | 21 +- docs/UpgradeAutoScalingType.md | 19 +- docs/UpgradeInstanceRequest.md | 21 +- docs/UpgradeObjectStorageRequest.md | 21 +- docs/UpgradeObjectStorageResponse.md | 23 +- docs/UpgradeObjectStorageResponseData.md | 21 +- docs/UserAuditResponse.md | 21 +- docs/UserIsPasswordSetResponse.md | 19 +- docs/UserResponse.md | 21 +- docs/UsersApi.md | 544 +- docs/UsersAuditsApi.md | 66 +- docs/VncResponse.md | 19 +- pfruck_contabo/__init__.py | 224 +- pfruck_contabo/api/__init__.py | 30 +- pfruck_contabo/api/images_api.py | 2783 +++++--- pfruck_contabo/api/images_audits_api.py | 642 +- pfruck_contabo/api/instance_actions_api.py | 2741 +++++--- .../api/instance_actions_audits_api.py | 642 +- pfruck_contabo/api/instances_api.py | 3438 ++++++---- pfruck_contabo/api/instances_audits_api.py | 642 +- pfruck_contabo/api/internal_api.py | 901 ++- pfruck_contabo/api/object_storages_api.py | 3950 ++++++++---- .../api/object_storages_audits_api.py | 642 +- pfruck_contabo/api/private_networks_api.py | 3243 ++++++---- .../api/private_networks_audits_api.py | 642 +- pfruck_contabo/api/roles_api.py | 2845 ++++++--- pfruck_contabo/api/roles_audits_api.py | 642 +- pfruck_contabo/api/secrets_api.py | 2371 ++++--- pfruck_contabo/api/secrets_audits_api.py | 642 +- pfruck_contabo/api/snapshots_api.py | 2880 ++++++--- pfruck_contabo/api/snapshots_audits_api.py | 665 +- pfruck_contabo/api/tag_assignments_api.py | 2005 ++++-- .../api/tag_assignments_audits_api.py | 665 +- pfruck_contabo/api/tags_api.py | 2342 ++++--- pfruck_contabo/api/tags_audits_api.py | 642 +- pfruck_contabo/api/users_api.py | 5675 +++++++++++------ pfruck_contabo/api/users_audits_api.py | 642 +- pfruck_contabo/api_client.py | 1190 ++-- pfruck_contabo/api_response.py | 21 + pfruck_contabo/configuration.py | 130 +- pfruck_contabo/exceptions.py | 101 +- pfruck_contabo/models/__init__.py | 453 +- .../models/add_on_quantity_request.py | 87 + pfruck_contabo/models/add_on_request.py | 89 + pfruck_contabo/models/add_on_response.py | 89 + pfruck_contabo/models/additional_ip.py | 91 + .../models/api_permissions_response.py | 97 + pfruck_contabo/models/application_config.py | 91 + .../models/application_requirements.py | 97 + pfruck_contabo/models/application_response.py | 128 + ...ssign_instance_private_network_response.py | 91 + .../models/assigned_tag_response.py | 90 + .../models/assignment_audit_response.py | 120 + pfruck_contabo/models/assignment_response.py | 100 + .../models/auto_scaling_type_request.py | 96 + .../models/auto_scaling_type_response.py | 98 + .../models/cancel_instance_response.py | 101 + .../models/cancel_instance_response_data.py | 95 + .../models/cancel_object_storage_response.py | 101 + .../cancel_object_storage_response_data.py | 97 + pfruck_contabo/models/client_response.py | 96 + .../models/client_secret_response.py | 92 + .../models/create_assignment_response.py | 91 + .../create_custom_image_fail_response.py | 89 + .../models/create_custom_image_request.py | 102 + .../models/create_custom_image_response.py | 101 + .../create_custom_image_response_data.py | 92 + .../models/create_instance_addons.py | 107 + .../models/create_instance_request.py | 144 + .../models/create_instance_response.py | 101 + .../models/create_instance_response_data.py | 118 + .../models/create_object_storage_request.py | 98 + .../models/create_object_storage_response.py | 101 + .../create_object_storage_response_data.py | 128 + .../models/create_private_network_request.py | 92 + .../models/create_private_network_response.py | 101 + pfruck_contabo/models/create_role_request.py | 102 + pfruck_contabo/models/create_role_response.py | 101 + .../models/create_role_response_data.py | 92 + .../models/create_secret_request.py | 99 + .../models/create_secret_response.py | 101 + .../models/create_snapshot_request.py | 90 + .../models/create_snapshot_response.py | 101 + pfruck_contabo/models/create_tag_request.py | 90 + pfruck_contabo/models/create_tag_response.py | 101 + .../models/create_tag_response_data.py | 92 + .../models/create_ticket_request.py | 92 + .../models/create_ticket_response.py | 101 + .../models/create_ticket_response_data.py | 90 + pfruck_contabo/models/create_user_request.py | 107 + pfruck_contabo/models/create_user_response.py | 101 + .../models/create_user_response_data.py | 92 + pfruck_contabo/models/credential_data.py | 102 + .../models/custom_images_stats_response.py | 101 + .../custom_images_stats_response_data.py | 98 + pfruck_contabo/models/data_center_response.py | 110 + .../models/extra_storage_request.py | 89 + .../models/find_assignment_response.py | 101 + pfruck_contabo/models/find_client_response.py | 101 + .../models/find_credential_response.py | 101 + pfruck_contabo/models/find_image_response.py | 101 + .../models/find_instance_response.py | 101 + .../models/find_object_storage_response.py | 101 + .../models/find_private_network_response.py | 101 + pfruck_contabo/models/find_role_response.py | 101 + pfruck_contabo/models/find_secret_response.py | 101 + .../models/find_snapshot_response.py | 101 + pfruck_contabo/models/find_tag_response.py | 101 + .../find_user_is_password_set_response.py | 101 + pfruck_contabo/models/find_user_response.py | 101 + pfruck_contabo/models/find_vnc_response.py | 101 + .../models/firewalling_upgrade_request.py | 87 + .../models/generate_client_secret_response.py | 101 + pfruck_contabo/models/image_audit_response.py | 107 + .../models/image_audit_response_data.py | 116 + pfruck_contabo/models/image_response.py | 133 + .../models/instance_assignment_self_links.py | 91 + .../models/instance_rescue_action_response.py | 101 + .../instance_rescue_action_response_data.py | 94 + ...instance_reset_password_action_response.py | 101 + ...nce_reset_password_action_response_data.py | 94 + pfruck_contabo/models/instance_response.py | 197 + .../instance_restart_action_response.py | 101 + .../instance_restart_action_response_data.py | 94 + .../instance_shutdown_action_response.py | 101 + .../instance_shutdown_action_response_data.py | 94 + .../models/instance_start_action_response.py | 101 + .../instance_start_action_response_data.py | 94 + pfruck_contabo/models/instance_status.py | 48 + .../models/instance_stop_action_response.py | 101 + .../instance_stop_action_response_data.py | 94 + pfruck_contabo/models/instances.py | 116 + .../instances_actions_audit_response.py | 116 + .../instances_actions_rescue_request.py | 91 + .../models/instances_audit_response.py | 116 + ...nstances_reset_password_actions_request.py | 91 + pfruck_contabo/models/ip_config.py | 97 + pfruck_contabo/models/ip_v4.py | 91 + pfruck_contabo/models/ip_v6.py | 91 + pfruck_contabo/models/links.py | 95 + .../models/list_api_permission_response.py | 101 + .../models/list_applications_response.py | 107 + .../models/list_assignment_audits_response.py | 107 + .../models/list_assignment_response.py | 107 + .../models/list_credential_response.py | 107 + .../models/list_data_center_response.py | 107 + pfruck_contabo/models/list_image_response.py | 107 + .../models/list_image_response_data.py | 143 + .../list_instances_actions_audit_response.py | 107 + .../models/list_instances_audit_response.py | 107 + .../models/list_instances_response.py | 107 + .../models/list_instances_response_data.py | 197 + .../list_object_storage_audit_response.py | 107 + .../models/list_object_storage_response.py | 107 + .../list_private_network_audit_response.py | 107 + .../models/list_private_network_response.py | 107 + .../list_private_network_response_data.py | 119 + .../models/list_role_audit_response.py | 101 + pfruck_contabo/models/list_role_response.py | 107 + .../models/list_secret_audit_response.py | 107 + pfruck_contabo/models/list_secret_response.py | 107 + .../models/list_snapshot_response.py | 107 + .../models/list_snapshots_audit_response.py | 107 + .../models/list_tag_audits_response.py | 107 + pfruck_contabo/models/list_tag_response.py | 107 + .../models/list_user_audit_response.py | 107 + pfruck_contabo/models/list_user_response.py | 107 + pfruck_contabo/models/minimum_requirements.py | 91 + .../models/object_storage_audit_response.py | 116 + .../models/object_storage_response.py | 124 + .../models/object_storages_stats_response.py | 101 + .../object_storages_stats_response_data.py | 96 + pfruck_contabo/models/optimal_requirements.py | 91 + pfruck_contabo/models/pagination_meta.py | 93 + .../models/patch_instance_request.py | 88 + .../models/patch_instance_response.py | 101 + .../models/patch_instance_response_data.py | 95 + .../models/patch_object_storage_request.py | 88 + .../models/patch_private_network_request.py | 90 + .../models/patch_private_network_response.py | 101 + pfruck_contabo/models/patch_vnc_request.py | 87 + pfruck_contabo/models/permission_request.py | 100 + pfruck_contabo/models/permission_response.py | 107 + pfruck_contabo/models/private_ip_config.py | 95 + .../models/private_network_audit_response.py | 116 + .../models/private_network_response.py | 119 + .../models/reinstall_instance_request.py | 107 + .../models/reinstall_instance_response.py | 101 + .../reinstall_instance_response_data.py | 95 + .../models/resource_permissions_response.py | 89 + pfruck_contabo/models/role_audit_response.py | 116 + pfruck_contabo/models/role_response.py | 110 + .../models/rollback_snapshot_response.py | 91 + .../models/secret_audit_response.py | 116 + pfruck_contabo/models/secret_response.py | 110 + pfruck_contabo/models/self_links.py | 87 + pfruck_contabo/models/snapshot_response.py | 107 + .../models/snapshots_audit_response.py | 118 + .../models/tag_assignment_self_links.py | 91 + pfruck_contabo/models/tag_audit_response.py | 116 + pfruck_contabo/models/tag_response.py | 96 + ...ssign_instance_private_network_response.py | 91 + .../models/update_custom_image_request.py | 89 + .../models/update_custom_image_response.py | 101 + .../update_custom_image_response_data.py | 92 + pfruck_contabo/models/update_role_request.py | 102 + pfruck_contabo/models/update_role_response.py | 91 + .../models/update_secret_request.py | 90 + .../models/update_secret_response.py | 91 + .../models/update_snapshot_request.py | 90 + .../models/update_snapshot_response.py | 101 + pfruck_contabo/models/update_tag_request.py | 90 + pfruck_contabo/models/update_tag_response.py | 91 + pfruck_contabo/models/update_user_request.py | 110 + pfruck_contabo/models/update_user_response.py | 91 + .../models/upgrade_auto_scaling_type.py | 99 + .../models/upgrade_instance_request.py | 87 + .../models/upgrade_object_storage_request.py | 93 + .../models/upgrade_object_storage_response.py | 101 + .../upgrade_object_storage_response_data.py | 119 + pfruck_contabo/models/user_audit_response.py | 116 + .../models/user_is_password_set_response.py | 92 + pfruck_contabo/models/user_response.py | 125 + pfruck_contabo/models/vnc_response.py | 105 + pfruck_contabo/py.typed | 0 pfruck_contabo/rest.py | 373 +- pyproject.toml | 71 + requirements.txt | 4 +- setup.py | 147 +- test-requirements.txt | 4 + 429 files changed, 53201 insertions(+), 19415 deletions(-) create mode 100644 .github/workflows/python.yml create mode 100644 pfruck_contabo/api_response.py create mode 100644 pfruck_contabo/models/add_on_quantity_request.py create mode 100644 pfruck_contabo/models/add_on_request.py create mode 100644 pfruck_contabo/models/add_on_response.py create mode 100644 pfruck_contabo/models/additional_ip.py create mode 100644 pfruck_contabo/models/api_permissions_response.py create mode 100644 pfruck_contabo/models/application_config.py create mode 100644 pfruck_contabo/models/application_requirements.py create mode 100644 pfruck_contabo/models/application_response.py create mode 100644 pfruck_contabo/models/assign_instance_private_network_response.py create mode 100644 pfruck_contabo/models/assigned_tag_response.py create mode 100644 pfruck_contabo/models/assignment_audit_response.py create mode 100644 pfruck_contabo/models/assignment_response.py create mode 100644 pfruck_contabo/models/auto_scaling_type_request.py create mode 100644 pfruck_contabo/models/auto_scaling_type_response.py create mode 100644 pfruck_contabo/models/cancel_instance_response.py create mode 100644 pfruck_contabo/models/cancel_instance_response_data.py create mode 100644 pfruck_contabo/models/cancel_object_storage_response.py create mode 100644 pfruck_contabo/models/cancel_object_storage_response_data.py create mode 100644 pfruck_contabo/models/client_response.py create mode 100644 pfruck_contabo/models/client_secret_response.py create mode 100644 pfruck_contabo/models/create_assignment_response.py create mode 100644 pfruck_contabo/models/create_custom_image_fail_response.py create mode 100644 pfruck_contabo/models/create_custom_image_request.py create mode 100644 pfruck_contabo/models/create_custom_image_response.py create mode 100644 pfruck_contabo/models/create_custom_image_response_data.py create mode 100644 pfruck_contabo/models/create_instance_addons.py create mode 100644 pfruck_contabo/models/create_instance_request.py create mode 100644 pfruck_contabo/models/create_instance_response.py create mode 100644 pfruck_contabo/models/create_instance_response_data.py create mode 100644 pfruck_contabo/models/create_object_storage_request.py create mode 100644 pfruck_contabo/models/create_object_storage_response.py create mode 100644 pfruck_contabo/models/create_object_storage_response_data.py create mode 100644 pfruck_contabo/models/create_private_network_request.py create mode 100644 pfruck_contabo/models/create_private_network_response.py create mode 100644 pfruck_contabo/models/create_role_request.py create mode 100644 pfruck_contabo/models/create_role_response.py create mode 100644 pfruck_contabo/models/create_role_response_data.py create mode 100644 pfruck_contabo/models/create_secret_request.py create mode 100644 pfruck_contabo/models/create_secret_response.py create mode 100644 pfruck_contabo/models/create_snapshot_request.py create mode 100644 pfruck_contabo/models/create_snapshot_response.py create mode 100644 pfruck_contabo/models/create_tag_request.py create mode 100644 pfruck_contabo/models/create_tag_response.py create mode 100644 pfruck_contabo/models/create_tag_response_data.py create mode 100644 pfruck_contabo/models/create_ticket_request.py create mode 100644 pfruck_contabo/models/create_ticket_response.py create mode 100644 pfruck_contabo/models/create_ticket_response_data.py create mode 100644 pfruck_contabo/models/create_user_request.py create mode 100644 pfruck_contabo/models/create_user_response.py create mode 100644 pfruck_contabo/models/create_user_response_data.py create mode 100644 pfruck_contabo/models/credential_data.py create mode 100644 pfruck_contabo/models/custom_images_stats_response.py create mode 100644 pfruck_contabo/models/custom_images_stats_response_data.py create mode 100644 pfruck_contabo/models/data_center_response.py create mode 100644 pfruck_contabo/models/extra_storage_request.py create mode 100644 pfruck_contabo/models/find_assignment_response.py create mode 100644 pfruck_contabo/models/find_client_response.py create mode 100644 pfruck_contabo/models/find_credential_response.py create mode 100644 pfruck_contabo/models/find_image_response.py create mode 100644 pfruck_contabo/models/find_instance_response.py create mode 100644 pfruck_contabo/models/find_object_storage_response.py create mode 100644 pfruck_contabo/models/find_private_network_response.py create mode 100644 pfruck_contabo/models/find_role_response.py create mode 100644 pfruck_contabo/models/find_secret_response.py create mode 100644 pfruck_contabo/models/find_snapshot_response.py create mode 100644 pfruck_contabo/models/find_tag_response.py create mode 100644 pfruck_contabo/models/find_user_is_password_set_response.py create mode 100644 pfruck_contabo/models/find_user_response.py create mode 100644 pfruck_contabo/models/find_vnc_response.py create mode 100644 pfruck_contabo/models/firewalling_upgrade_request.py create mode 100644 pfruck_contabo/models/generate_client_secret_response.py create mode 100644 pfruck_contabo/models/image_audit_response.py create mode 100644 pfruck_contabo/models/image_audit_response_data.py create mode 100644 pfruck_contabo/models/image_response.py create mode 100644 pfruck_contabo/models/instance_assignment_self_links.py create mode 100644 pfruck_contabo/models/instance_rescue_action_response.py create mode 100644 pfruck_contabo/models/instance_rescue_action_response_data.py create mode 100644 pfruck_contabo/models/instance_reset_password_action_response.py create mode 100644 pfruck_contabo/models/instance_reset_password_action_response_data.py create mode 100644 pfruck_contabo/models/instance_response.py create mode 100644 pfruck_contabo/models/instance_restart_action_response.py create mode 100644 pfruck_contabo/models/instance_restart_action_response_data.py create mode 100644 pfruck_contabo/models/instance_shutdown_action_response.py create mode 100644 pfruck_contabo/models/instance_shutdown_action_response_data.py create mode 100644 pfruck_contabo/models/instance_start_action_response.py create mode 100644 pfruck_contabo/models/instance_start_action_response_data.py create mode 100644 pfruck_contabo/models/instance_status.py create mode 100644 pfruck_contabo/models/instance_stop_action_response.py create mode 100644 pfruck_contabo/models/instance_stop_action_response_data.py create mode 100644 pfruck_contabo/models/instances.py create mode 100644 pfruck_contabo/models/instances_actions_audit_response.py create mode 100644 pfruck_contabo/models/instances_actions_rescue_request.py create mode 100644 pfruck_contabo/models/instances_audit_response.py create mode 100644 pfruck_contabo/models/instances_reset_password_actions_request.py create mode 100644 pfruck_contabo/models/ip_config.py create mode 100644 pfruck_contabo/models/ip_v4.py create mode 100644 pfruck_contabo/models/ip_v6.py create mode 100644 pfruck_contabo/models/links.py create mode 100644 pfruck_contabo/models/list_api_permission_response.py create mode 100644 pfruck_contabo/models/list_applications_response.py create mode 100644 pfruck_contabo/models/list_assignment_audits_response.py create mode 100644 pfruck_contabo/models/list_assignment_response.py create mode 100644 pfruck_contabo/models/list_credential_response.py create mode 100644 pfruck_contabo/models/list_data_center_response.py create mode 100644 pfruck_contabo/models/list_image_response.py create mode 100644 pfruck_contabo/models/list_image_response_data.py create mode 100644 pfruck_contabo/models/list_instances_actions_audit_response.py create mode 100644 pfruck_contabo/models/list_instances_audit_response.py create mode 100644 pfruck_contabo/models/list_instances_response.py create mode 100644 pfruck_contabo/models/list_instances_response_data.py create mode 100644 pfruck_contabo/models/list_object_storage_audit_response.py create mode 100644 pfruck_contabo/models/list_object_storage_response.py create mode 100644 pfruck_contabo/models/list_private_network_audit_response.py create mode 100644 pfruck_contabo/models/list_private_network_response.py create mode 100644 pfruck_contabo/models/list_private_network_response_data.py create mode 100644 pfruck_contabo/models/list_role_audit_response.py create mode 100644 pfruck_contabo/models/list_role_response.py create mode 100644 pfruck_contabo/models/list_secret_audit_response.py create mode 100644 pfruck_contabo/models/list_secret_response.py create mode 100644 pfruck_contabo/models/list_snapshot_response.py create mode 100644 pfruck_contabo/models/list_snapshots_audit_response.py create mode 100644 pfruck_contabo/models/list_tag_audits_response.py create mode 100644 pfruck_contabo/models/list_tag_response.py create mode 100644 pfruck_contabo/models/list_user_audit_response.py create mode 100644 pfruck_contabo/models/list_user_response.py create mode 100644 pfruck_contabo/models/minimum_requirements.py create mode 100644 pfruck_contabo/models/object_storage_audit_response.py create mode 100644 pfruck_contabo/models/object_storage_response.py create mode 100644 pfruck_contabo/models/object_storages_stats_response.py create mode 100644 pfruck_contabo/models/object_storages_stats_response_data.py create mode 100644 pfruck_contabo/models/optimal_requirements.py create mode 100644 pfruck_contabo/models/pagination_meta.py create mode 100644 pfruck_contabo/models/patch_instance_request.py create mode 100644 pfruck_contabo/models/patch_instance_response.py create mode 100644 pfruck_contabo/models/patch_instance_response_data.py create mode 100644 pfruck_contabo/models/patch_object_storage_request.py create mode 100644 pfruck_contabo/models/patch_private_network_request.py create mode 100644 pfruck_contabo/models/patch_private_network_response.py create mode 100644 pfruck_contabo/models/patch_vnc_request.py create mode 100644 pfruck_contabo/models/permission_request.py create mode 100644 pfruck_contabo/models/permission_response.py create mode 100644 pfruck_contabo/models/private_ip_config.py create mode 100644 pfruck_contabo/models/private_network_audit_response.py create mode 100644 pfruck_contabo/models/private_network_response.py create mode 100644 pfruck_contabo/models/reinstall_instance_request.py create mode 100644 pfruck_contabo/models/reinstall_instance_response.py create mode 100644 pfruck_contabo/models/reinstall_instance_response_data.py create mode 100644 pfruck_contabo/models/resource_permissions_response.py create mode 100644 pfruck_contabo/models/role_audit_response.py create mode 100644 pfruck_contabo/models/role_response.py create mode 100644 pfruck_contabo/models/rollback_snapshot_response.py create mode 100644 pfruck_contabo/models/secret_audit_response.py create mode 100644 pfruck_contabo/models/secret_response.py create mode 100644 pfruck_contabo/models/self_links.py create mode 100644 pfruck_contabo/models/snapshot_response.py create mode 100644 pfruck_contabo/models/snapshots_audit_response.py create mode 100644 pfruck_contabo/models/tag_assignment_self_links.py create mode 100644 pfruck_contabo/models/tag_audit_response.py create mode 100644 pfruck_contabo/models/tag_response.py create mode 100644 pfruck_contabo/models/unassign_instance_private_network_response.py create mode 100644 pfruck_contabo/models/update_custom_image_request.py create mode 100644 pfruck_contabo/models/update_custom_image_response.py create mode 100644 pfruck_contabo/models/update_custom_image_response_data.py create mode 100644 pfruck_contabo/models/update_role_request.py create mode 100644 pfruck_contabo/models/update_role_response.py create mode 100644 pfruck_contabo/models/update_secret_request.py create mode 100644 pfruck_contabo/models/update_secret_response.py create mode 100644 pfruck_contabo/models/update_snapshot_request.py create mode 100644 pfruck_contabo/models/update_snapshot_response.py create mode 100644 pfruck_contabo/models/update_tag_request.py create mode 100644 pfruck_contabo/models/update_tag_response.py create mode 100644 pfruck_contabo/models/update_user_request.py create mode 100644 pfruck_contabo/models/update_user_response.py create mode 100644 pfruck_contabo/models/upgrade_auto_scaling_type.py create mode 100644 pfruck_contabo/models/upgrade_instance_request.py create mode 100644 pfruck_contabo/models/upgrade_object_storage_request.py create mode 100644 pfruck_contabo/models/upgrade_object_storage_response.py create mode 100644 pfruck_contabo/models/upgrade_object_storage_response_data.py create mode 100644 pfruck_contabo/models/user_audit_response.py create mode 100644 pfruck_contabo/models/user_is_password_set_response.py create mode 100644 pfruck_contabo/models/user_response.py create mode 100644 pfruck_contabo/models/vnc_response.py create mode 100644 pfruck_contabo/py.typed create mode 100644 pyproject.toml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..471a23b --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,38 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: pfruck_contabo Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 583c29a..611409a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,24 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# # ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml stages: - test -.tests: +.pytest: stage: test script: - pip install -r requirements.txt - pip install -r test-requirements.txt - pytest --cov=pfruck_contabo -test-3.6: - extends: .tests - image: python:3.6-alpine -test-3.7: - extends: .tests +pytest-3.7: + extends: .pytest image: python:3.7-alpine -test-3.8: - extends: .tests +pytest-3.8: + extends: .pytest image: python:3.8-alpine -test-3.9: - extends: .tests +pytest-3.9: + extends: .pytest image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 8363345..5e8669f 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.github/workflows/python.yml .gitignore .gitlab-ci.yml .travis.yml @@ -9,12 +10,8 @@ docs/AdditionalIp.md docs/ApiPermissionsResponse.md docs/ApplicationConfig.md docs/ApplicationRequirements.md -docs/ApplicationRequirementsMinimum.md -docs/ApplicationRequirementsOptimal.md docs/ApplicationResponse.md -docs/ApplicationResponseRequirements.md docs/AssignInstancePrivateNetworkResponse.md -docs/AssignInstancePrivateNetworkResponseLinks.md docs/AssignedTagResponse.md docs/AssignmentAuditResponse.md docs/AssignmentResponse.md @@ -27,63 +24,45 @@ docs/CancelObjectStorageResponseData.md docs/ClientResponse.md docs/ClientSecretResponse.md docs/CreateAssignmentResponse.md -docs/CreateAssignmentResponseLinks.md docs/CreateCustomImageFailResponse.md docs/CreateCustomImageRequest.md docs/CreateCustomImageResponse.md docs/CreateCustomImageResponseData.md -docs/CreateCustomImageResponseLinks.md docs/CreateInstanceAddons.md -docs/CreateInstanceAddonsExtraStorage.md docs/CreateInstanceRequest.md -docs/CreateInstanceRequestAddOns.md docs/CreateInstanceResponse.md docs/CreateInstanceResponseData.md docs/CreateObjectStorageRequest.md -docs/CreateObjectStorageRequestAutoScaling.md docs/CreateObjectStorageResponse.md docs/CreateObjectStorageResponseData.md -docs/CreateObjectStorageResponseLinks.md docs/CreatePrivateNetworkRequest.md docs/CreatePrivateNetworkResponse.md -docs/CreatePrivateNetworkResponseLinks.md docs/CreateRoleRequest.md docs/CreateRoleResponse.md docs/CreateRoleResponseData.md -docs/CreateRoleResponseLinks.md docs/CreateSecretRequest.md docs/CreateSecretResponse.md -docs/CreateSecretResponseLinks.md docs/CreateSnapshotRequest.md docs/CreateSnapshotResponse.md -docs/CreateSnapshotResponseLinks.md docs/CreateTagRequest.md docs/CreateTagResponse.md docs/CreateTagResponseData.md -docs/CreateTagResponseLinks.md docs/CreateTicketRequest.md docs/CreateTicketResponse.md docs/CreateTicketResponseData.md -docs/CreateTicketResponseLinks.md docs/CreateUserRequest.md docs/CreateUserResponse.md docs/CreateUserResponseData.md -docs/CreateUserResponseLinks.md docs/CredentialData.md docs/CustomImagesStatsResponse.md docs/CustomImagesStatsResponseData.md -docs/CustomImagesStatsResponseLinks.md docs/DataCenterResponse.md docs/ExtraStorageRequest.md docs/FindAssignmentResponse.md -docs/FindAssignmentResponseLinks.md docs/FindClientResponse.md -docs/FindClientResponseLinks.md docs/FindCredentialResponse.md -docs/FindCredentialResponseLinks.md docs/FindImageResponse.md docs/FindInstanceResponse.md -docs/FindInstanceResponseLinks.md docs/FindObjectStorageResponse.md docs/FindPrivateNetworkResponse.md docs/FindRoleResponse.md @@ -91,16 +70,12 @@ docs/FindSecretResponse.md docs/FindSnapshotResponse.md docs/FindTagResponse.md docs/FindUserIsPasswordSetResponse.md -docs/FindUserIsPasswordSetResponseLinks.md docs/FindUserResponse.md docs/FindVncResponse.md -docs/FindVncResponseLinks.md docs/FirewallingUpgradeRequest.md docs/GenerateClientSecretResponse.md -docs/GenerateClientSecretResponseLinks.md docs/ImageAuditResponse.md docs/ImageAuditResponseData.md -docs/ImageAuditResponseLinks.md docs/ImageResponse.md docs/ImagesApi.md docs/ImagesAuditsApi.md @@ -109,24 +84,18 @@ docs/InstanceActionsAuditsApi.md docs/InstanceAssignmentSelfLinks.md docs/InstanceRescueActionResponse.md docs/InstanceRescueActionResponseData.md -docs/InstanceRescueActionResponseLinks.md docs/InstanceResetPasswordActionResponse.md docs/InstanceResetPasswordActionResponseData.md -docs/InstanceResetPasswordActionResponseLinks.md docs/InstanceResponse.md docs/InstanceRestartActionResponse.md docs/InstanceRestartActionResponseData.md -docs/InstanceRestartActionResponseLinks.md docs/InstanceShutdownActionResponse.md docs/InstanceShutdownActionResponseData.md -docs/InstanceShutdownActionResponseLinks.md docs/InstanceStartActionResponse.md docs/InstanceStartActionResponseData.md -docs/InstanceStartActionResponseLinks.md docs/InstanceStatus.md docs/InstanceStopActionResponse.md docs/InstanceStopActionResponseData.md -docs/InstanceStopActionResponseLinks.md docs/Instances.md docs/InstancesActionsAuditResponse.md docs/InstancesActionsRescueRequest.md @@ -140,72 +109,44 @@ docs/IpV4.md docs/IpV6.md docs/Links.md docs/ListApiPermissionResponse.md -docs/ListApiPermissionResponseLinks.md docs/ListApplicationsResponse.md -docs/ListApplicationsResponseLinks.md docs/ListAssignmentAuditsResponse.md -docs/ListAssignmentAuditsResponseLinks.md docs/ListAssignmentResponse.md -docs/ListAssignmentResponseLinks.md docs/ListCredentialResponse.md -docs/ListCredentialResponseLinks.md docs/ListDataCenterResponse.md -docs/ListDataCenterResponseLinks.md docs/ListImageResponse.md docs/ListImageResponseData.md -docs/ListImageResponseLinks.md docs/ListInstancesActionsAuditResponse.md -docs/ListInstancesActionsAuditResponseLinks.md docs/ListInstancesAuditResponse.md -docs/ListInstancesAuditResponseLinks.md docs/ListInstancesResponse.md docs/ListInstancesResponseData.md -docs/ListInstancesResponseLinks.md -docs/ListInstancesResponsePagination.md docs/ListObjectStorageAuditResponse.md -docs/ListObjectStorageAuditResponseLinks.md docs/ListObjectStorageResponse.md -docs/ListObjectStorageResponseLinks.md docs/ListPrivateNetworkAuditResponse.md -docs/ListPrivateNetworkAuditResponseLinks.md docs/ListPrivateNetworkResponse.md docs/ListPrivateNetworkResponseData.md -docs/ListPrivateNetworkResponseLinks.md docs/ListRoleAuditResponse.md -docs/ListRoleAuditResponseLinks.md docs/ListRoleResponse.md -docs/ListRoleResponseLinks.md docs/ListSecretAuditResponse.md -docs/ListSecretAuditResponseLinks.md docs/ListSecretResponse.md -docs/ListSecretResponseLinks.md docs/ListSnapshotResponse.md -docs/ListSnapshotResponseLinks.md docs/ListSnapshotsAuditResponse.md -docs/ListSnapshotsAuditResponseLinks.md docs/ListTagAuditsResponse.md -docs/ListTagAuditsResponseLinks.md docs/ListTagResponse.md -docs/ListTagResponseLinks.md docs/ListUserAuditResponse.md -docs/ListUserAuditResponseLinks.md docs/ListUserResponse.md -docs/ListUserResponseLinks.md docs/MinimumRequirements.md docs/ObjectStorageAuditResponse.md docs/ObjectStorageResponse.md -docs/ObjectStorageResponseAutoScaling.md docs/ObjectStoragesApi.md docs/ObjectStoragesAuditsApi.md docs/ObjectStoragesStatsResponse.md docs/ObjectStoragesStatsResponseData.md -docs/ObjectStoragesStatsResponseLinks.md docs/OptimalRequirements.md docs/PaginationMeta.md docs/PatchInstanceRequest.md docs/PatchInstanceResponse.md docs/PatchInstanceResponseData.md -docs/PatchInstanceResponseLinks.md docs/PatchObjectStorageRequest.md docs/PatchPrivateNetworkRequest.md docs/PatchPrivateNetworkResponse.md @@ -226,7 +167,6 @@ docs/RoleResponse.md docs/RolesApi.md docs/RolesAuditsApi.md docs/RollbackSnapshotResponse.md -docs/RollbackSnapshotResponseLinks.md docs/SecretAuditResponse.md docs/SecretResponse.md docs/SecretsApi.md @@ -249,26 +189,19 @@ docs/UpdateCustomImageResponse.md docs/UpdateCustomImageResponseData.md docs/UpdateRoleRequest.md docs/UpdateRoleResponse.md -docs/UpdateRoleResponseLinks.md docs/UpdateSecretRequest.md docs/UpdateSecretResponse.md -docs/UpdateSecretResponseLinks.md docs/UpdateSnapshotRequest.md docs/UpdateSnapshotResponse.md docs/UpdateTagRequest.md docs/UpdateTagResponse.md -docs/UpdateTagResponseLinks.md docs/UpdateUserRequest.md docs/UpdateUserResponse.md -docs/UpdateUserResponseLinks.md docs/UpgradeAutoScalingType.md docs/UpgradeInstanceRequest.md docs/UpgradeObjectStorageRequest.md -docs/UpgradeObjectStorageRequestAutoScaling.md docs/UpgradeObjectStorageResponse.md docs/UpgradeObjectStorageResponseData.md -docs/UpgradeObjectStorageResponseDataAutoScaling.md -docs/UpgradeObjectStorageResponseLinks.md docs/UserAuditResponse.md docs/UserIsPasswordSetResponse.md docs/UserResponse.md @@ -301,539 +234,198 @@ pfruck_contabo/api/tags_audits_api.py pfruck_contabo/api/users_api.py pfruck_contabo/api/users_audits_api.py pfruck_contabo/api_client.py -pfruck_contabo/apis/__init__.py +pfruck_contabo/api_response.py pfruck_contabo/configuration.py pfruck_contabo/exceptions.py -pfruck_contabo/model/__init__.py -pfruck_contabo/model/add_on_quantity_request.py -pfruck_contabo/model/add_on_request.py -pfruck_contabo/model/add_on_response.py -pfruck_contabo/model/additional_ip.py -pfruck_contabo/model/api_permissions_response.py -pfruck_contabo/model/application_config.py -pfruck_contabo/model/application_requirements.py -pfruck_contabo/model/application_requirements_minimum.py -pfruck_contabo/model/application_requirements_optimal.py -pfruck_contabo/model/application_response.py -pfruck_contabo/model/application_response_requirements.py -pfruck_contabo/model/assign_instance_private_network_response.py -pfruck_contabo/model/assign_instance_private_network_response_links.py -pfruck_contabo/model/assigned_tag_response.py -pfruck_contabo/model/assignment_audit_response.py -pfruck_contabo/model/assignment_response.py -pfruck_contabo/model/auto_scaling_type_request.py -pfruck_contabo/model/auto_scaling_type_response.py -pfruck_contabo/model/cancel_instance_response.py -pfruck_contabo/model/cancel_instance_response_data.py -pfruck_contabo/model/cancel_object_storage_response.py -pfruck_contabo/model/cancel_object_storage_response_data.py -pfruck_contabo/model/client_response.py -pfruck_contabo/model/client_secret_response.py -pfruck_contabo/model/create_assignment_response.py -pfruck_contabo/model/create_assignment_response_links.py -pfruck_contabo/model/create_custom_image_fail_response.py -pfruck_contabo/model/create_custom_image_request.py -pfruck_contabo/model/create_custom_image_response.py -pfruck_contabo/model/create_custom_image_response_data.py -pfruck_contabo/model/create_custom_image_response_links.py -pfruck_contabo/model/create_instance_addons.py -pfruck_contabo/model/create_instance_addons_extra_storage.py -pfruck_contabo/model/create_instance_request.py -pfruck_contabo/model/create_instance_request_add_ons.py -pfruck_contabo/model/create_instance_response.py -pfruck_contabo/model/create_instance_response_data.py -pfruck_contabo/model/create_object_storage_request.py -pfruck_contabo/model/create_object_storage_request_auto_scaling.py -pfruck_contabo/model/create_object_storage_response.py -pfruck_contabo/model/create_object_storage_response_data.py -pfruck_contabo/model/create_object_storage_response_links.py -pfruck_contabo/model/create_private_network_request.py -pfruck_contabo/model/create_private_network_response.py -pfruck_contabo/model/create_private_network_response_links.py -pfruck_contabo/model/create_role_request.py -pfruck_contabo/model/create_role_response.py -pfruck_contabo/model/create_role_response_data.py -pfruck_contabo/model/create_role_response_links.py -pfruck_contabo/model/create_secret_request.py -pfruck_contabo/model/create_secret_response.py -pfruck_contabo/model/create_secret_response_links.py -pfruck_contabo/model/create_snapshot_request.py -pfruck_contabo/model/create_snapshot_response.py -pfruck_contabo/model/create_snapshot_response_links.py -pfruck_contabo/model/create_tag_request.py -pfruck_contabo/model/create_tag_response.py -pfruck_contabo/model/create_tag_response_data.py -pfruck_contabo/model/create_tag_response_links.py -pfruck_contabo/model/create_ticket_request.py -pfruck_contabo/model/create_ticket_response.py -pfruck_contabo/model/create_ticket_response_data.py -pfruck_contabo/model/create_ticket_response_links.py -pfruck_contabo/model/create_user_request.py -pfruck_contabo/model/create_user_response.py -pfruck_contabo/model/create_user_response_data.py -pfruck_contabo/model/create_user_response_links.py -pfruck_contabo/model/credential_data.py -pfruck_contabo/model/custom_images_stats_response.py -pfruck_contabo/model/custom_images_stats_response_data.py -pfruck_contabo/model/custom_images_stats_response_links.py -pfruck_contabo/model/data_center_response.py -pfruck_contabo/model/extra_storage_request.py -pfruck_contabo/model/find_assignment_response.py -pfruck_contabo/model/find_assignment_response_links.py -pfruck_contabo/model/find_client_response.py -pfruck_contabo/model/find_client_response_links.py -pfruck_contabo/model/find_credential_response.py -pfruck_contabo/model/find_credential_response_links.py -pfruck_contabo/model/find_image_response.py -pfruck_contabo/model/find_instance_response.py -pfruck_contabo/model/find_instance_response_links.py -pfruck_contabo/model/find_object_storage_response.py -pfruck_contabo/model/find_private_network_response.py -pfruck_contabo/model/find_role_response.py -pfruck_contabo/model/find_secret_response.py -pfruck_contabo/model/find_snapshot_response.py -pfruck_contabo/model/find_tag_response.py -pfruck_contabo/model/find_user_is_password_set_response.py -pfruck_contabo/model/find_user_is_password_set_response_links.py -pfruck_contabo/model/find_user_response.py -pfruck_contabo/model/find_vnc_response.py -pfruck_contabo/model/find_vnc_response_links.py -pfruck_contabo/model/firewalling_upgrade_request.py -pfruck_contabo/model/generate_client_secret_response.py -pfruck_contabo/model/generate_client_secret_response_links.py -pfruck_contabo/model/image_audit_response.py -pfruck_contabo/model/image_audit_response_data.py -pfruck_contabo/model/image_audit_response_links.py -pfruck_contabo/model/image_response.py -pfruck_contabo/model/instance_assignment_self_links.py -pfruck_contabo/model/instance_rescue_action_response.py -pfruck_contabo/model/instance_rescue_action_response_data.py -pfruck_contabo/model/instance_rescue_action_response_links.py -pfruck_contabo/model/instance_reset_password_action_response.py -pfruck_contabo/model/instance_reset_password_action_response_data.py -pfruck_contabo/model/instance_reset_password_action_response_links.py -pfruck_contabo/model/instance_response.py -pfruck_contabo/model/instance_restart_action_response.py -pfruck_contabo/model/instance_restart_action_response_data.py -pfruck_contabo/model/instance_restart_action_response_links.py -pfruck_contabo/model/instance_shutdown_action_response.py -pfruck_contabo/model/instance_shutdown_action_response_data.py -pfruck_contabo/model/instance_shutdown_action_response_links.py -pfruck_contabo/model/instance_start_action_response.py -pfruck_contabo/model/instance_start_action_response_data.py -pfruck_contabo/model/instance_start_action_response_links.py -pfruck_contabo/model/instance_status.py -pfruck_contabo/model/instance_stop_action_response.py -pfruck_contabo/model/instance_stop_action_response_data.py -pfruck_contabo/model/instance_stop_action_response_links.py -pfruck_contabo/model/instances.py -pfruck_contabo/model/instances_actions_audit_response.py -pfruck_contabo/model/instances_actions_rescue_request.py -pfruck_contabo/model/instances_audit_response.py -pfruck_contabo/model/instances_reset_password_actions_request.py -pfruck_contabo/model/ip_config.py -pfruck_contabo/model/ip_v4.py -pfruck_contabo/model/ip_v6.py -pfruck_contabo/model/links.py -pfruck_contabo/model/list_api_permission_response.py -pfruck_contabo/model/list_api_permission_response_links.py -pfruck_contabo/model/list_applications_response.py -pfruck_contabo/model/list_applications_response_links.py -pfruck_contabo/model/list_assignment_audits_response.py -pfruck_contabo/model/list_assignment_audits_response_links.py -pfruck_contabo/model/list_assignment_response.py -pfruck_contabo/model/list_assignment_response_links.py -pfruck_contabo/model/list_credential_response.py -pfruck_contabo/model/list_credential_response_links.py -pfruck_contabo/model/list_data_center_response.py -pfruck_contabo/model/list_data_center_response_links.py -pfruck_contabo/model/list_image_response.py -pfruck_contabo/model/list_image_response_data.py -pfruck_contabo/model/list_image_response_links.py -pfruck_contabo/model/list_instances_actions_audit_response.py -pfruck_contabo/model/list_instances_actions_audit_response_links.py -pfruck_contabo/model/list_instances_audit_response.py -pfruck_contabo/model/list_instances_audit_response_links.py -pfruck_contabo/model/list_instances_response.py -pfruck_contabo/model/list_instances_response_data.py -pfruck_contabo/model/list_instances_response_links.py -pfruck_contabo/model/list_instances_response_pagination.py -pfruck_contabo/model/list_object_storage_audit_response.py -pfruck_contabo/model/list_object_storage_audit_response_links.py -pfruck_contabo/model/list_object_storage_response.py -pfruck_contabo/model/list_object_storage_response_links.py -pfruck_contabo/model/list_private_network_audit_response.py -pfruck_contabo/model/list_private_network_audit_response_links.py -pfruck_contabo/model/list_private_network_response.py -pfruck_contabo/model/list_private_network_response_data.py -pfruck_contabo/model/list_private_network_response_links.py -pfruck_contabo/model/list_role_audit_response.py -pfruck_contabo/model/list_role_audit_response_links.py -pfruck_contabo/model/list_role_response.py -pfruck_contabo/model/list_role_response_links.py -pfruck_contabo/model/list_secret_audit_response.py -pfruck_contabo/model/list_secret_audit_response_links.py -pfruck_contabo/model/list_secret_response.py -pfruck_contabo/model/list_secret_response_links.py -pfruck_contabo/model/list_snapshot_response.py -pfruck_contabo/model/list_snapshot_response_links.py -pfruck_contabo/model/list_snapshots_audit_response.py -pfruck_contabo/model/list_snapshots_audit_response_links.py -pfruck_contabo/model/list_tag_audits_response.py -pfruck_contabo/model/list_tag_audits_response_links.py -pfruck_contabo/model/list_tag_response.py -pfruck_contabo/model/list_tag_response_links.py -pfruck_contabo/model/list_user_audit_response.py -pfruck_contabo/model/list_user_audit_response_links.py -pfruck_contabo/model/list_user_response.py -pfruck_contabo/model/list_user_response_links.py -pfruck_contabo/model/minimum_requirements.py -pfruck_contabo/model/object_storage_audit_response.py -pfruck_contabo/model/object_storage_response.py -pfruck_contabo/model/object_storage_response_auto_scaling.py -pfruck_contabo/model/object_storages_stats_response.py -pfruck_contabo/model/object_storages_stats_response_data.py -pfruck_contabo/model/object_storages_stats_response_links.py -pfruck_contabo/model/optimal_requirements.py -pfruck_contabo/model/pagination_meta.py -pfruck_contabo/model/patch_instance_request.py -pfruck_contabo/model/patch_instance_response.py -pfruck_contabo/model/patch_instance_response_data.py -pfruck_contabo/model/patch_instance_response_links.py -pfruck_contabo/model/patch_object_storage_request.py -pfruck_contabo/model/patch_private_network_request.py -pfruck_contabo/model/patch_private_network_response.py -pfruck_contabo/model/patch_vnc_request.py -pfruck_contabo/model/permission_request.py -pfruck_contabo/model/permission_response.py -pfruck_contabo/model/private_ip_config.py -pfruck_contabo/model/private_network_audit_response.py -pfruck_contabo/model/private_network_response.py -pfruck_contabo/model/reinstall_instance_request.py -pfruck_contabo/model/reinstall_instance_response.py -pfruck_contabo/model/reinstall_instance_response_data.py -pfruck_contabo/model/resource_permissions_response.py -pfruck_contabo/model/role_audit_response.py -pfruck_contabo/model/role_response.py -pfruck_contabo/model/rollback_snapshot_response.py -pfruck_contabo/model/rollback_snapshot_response_links.py -pfruck_contabo/model/secret_audit_response.py -pfruck_contabo/model/secret_response.py -pfruck_contabo/model/self_links.py -pfruck_contabo/model/snapshot_response.py -pfruck_contabo/model/snapshots_audit_response.py -pfruck_contabo/model/tag_assignment_self_links.py -pfruck_contabo/model/tag_audit_response.py -pfruck_contabo/model/tag_response.py -pfruck_contabo/model/unassign_instance_private_network_response.py -pfruck_contabo/model/update_custom_image_request.py -pfruck_contabo/model/update_custom_image_response.py -pfruck_contabo/model/update_custom_image_response_data.py -pfruck_contabo/model/update_role_request.py -pfruck_contabo/model/update_role_response.py -pfruck_contabo/model/update_role_response_links.py -pfruck_contabo/model/update_secret_request.py -pfruck_contabo/model/update_secret_response.py -pfruck_contabo/model/update_secret_response_links.py -pfruck_contabo/model/update_snapshot_request.py -pfruck_contabo/model/update_snapshot_response.py -pfruck_contabo/model/update_tag_request.py -pfruck_contabo/model/update_tag_response.py -pfruck_contabo/model/update_tag_response_links.py -pfruck_contabo/model/update_user_request.py -pfruck_contabo/model/update_user_response.py -pfruck_contabo/model/update_user_response_links.py -pfruck_contabo/model/upgrade_auto_scaling_type.py -pfruck_contabo/model/upgrade_instance_request.py -pfruck_contabo/model/upgrade_object_storage_request.py -pfruck_contabo/model/upgrade_object_storage_request_auto_scaling.py -pfruck_contabo/model/upgrade_object_storage_response.py -pfruck_contabo/model/upgrade_object_storage_response_data.py -pfruck_contabo/model/upgrade_object_storage_response_data_auto_scaling.py -pfruck_contabo/model/upgrade_object_storage_response_links.py -pfruck_contabo/model/user_audit_response.py -pfruck_contabo/model/user_is_password_set_response.py -pfruck_contabo/model/user_response.py -pfruck_contabo/model/vnc_response.py -pfruck_contabo/model_utils.py pfruck_contabo/models/__init__.py +pfruck_contabo/models/add_on_quantity_request.py +pfruck_contabo/models/add_on_request.py +pfruck_contabo/models/add_on_response.py +pfruck_contabo/models/additional_ip.py +pfruck_contabo/models/api_permissions_response.py +pfruck_contabo/models/application_config.py +pfruck_contabo/models/application_requirements.py +pfruck_contabo/models/application_response.py +pfruck_contabo/models/assign_instance_private_network_response.py +pfruck_contabo/models/assigned_tag_response.py +pfruck_contabo/models/assignment_audit_response.py +pfruck_contabo/models/assignment_response.py +pfruck_contabo/models/auto_scaling_type_request.py +pfruck_contabo/models/auto_scaling_type_response.py +pfruck_contabo/models/cancel_instance_response.py +pfruck_contabo/models/cancel_instance_response_data.py +pfruck_contabo/models/cancel_object_storage_response.py +pfruck_contabo/models/cancel_object_storage_response_data.py +pfruck_contabo/models/client_response.py +pfruck_contabo/models/client_secret_response.py +pfruck_contabo/models/create_assignment_response.py +pfruck_contabo/models/create_custom_image_fail_response.py +pfruck_contabo/models/create_custom_image_request.py +pfruck_contabo/models/create_custom_image_response.py +pfruck_contabo/models/create_custom_image_response_data.py +pfruck_contabo/models/create_instance_addons.py +pfruck_contabo/models/create_instance_request.py +pfruck_contabo/models/create_instance_response.py +pfruck_contabo/models/create_instance_response_data.py +pfruck_contabo/models/create_object_storage_request.py +pfruck_contabo/models/create_object_storage_response.py +pfruck_contabo/models/create_object_storage_response_data.py +pfruck_contabo/models/create_private_network_request.py +pfruck_contabo/models/create_private_network_response.py +pfruck_contabo/models/create_role_request.py +pfruck_contabo/models/create_role_response.py +pfruck_contabo/models/create_role_response_data.py +pfruck_contabo/models/create_secret_request.py +pfruck_contabo/models/create_secret_response.py +pfruck_contabo/models/create_snapshot_request.py +pfruck_contabo/models/create_snapshot_response.py +pfruck_contabo/models/create_tag_request.py +pfruck_contabo/models/create_tag_response.py +pfruck_contabo/models/create_tag_response_data.py +pfruck_contabo/models/create_ticket_request.py +pfruck_contabo/models/create_ticket_response.py +pfruck_contabo/models/create_ticket_response_data.py +pfruck_contabo/models/create_user_request.py +pfruck_contabo/models/create_user_response.py +pfruck_contabo/models/create_user_response_data.py +pfruck_contabo/models/credential_data.py +pfruck_contabo/models/custom_images_stats_response.py +pfruck_contabo/models/custom_images_stats_response_data.py +pfruck_contabo/models/data_center_response.py +pfruck_contabo/models/extra_storage_request.py +pfruck_contabo/models/find_assignment_response.py +pfruck_contabo/models/find_client_response.py +pfruck_contabo/models/find_credential_response.py +pfruck_contabo/models/find_image_response.py +pfruck_contabo/models/find_instance_response.py +pfruck_contabo/models/find_object_storage_response.py +pfruck_contabo/models/find_private_network_response.py +pfruck_contabo/models/find_role_response.py +pfruck_contabo/models/find_secret_response.py +pfruck_contabo/models/find_snapshot_response.py +pfruck_contabo/models/find_tag_response.py +pfruck_contabo/models/find_user_is_password_set_response.py +pfruck_contabo/models/find_user_response.py +pfruck_contabo/models/find_vnc_response.py +pfruck_contabo/models/firewalling_upgrade_request.py +pfruck_contabo/models/generate_client_secret_response.py +pfruck_contabo/models/image_audit_response.py +pfruck_contabo/models/image_audit_response_data.py +pfruck_contabo/models/image_response.py +pfruck_contabo/models/instance_assignment_self_links.py +pfruck_contabo/models/instance_rescue_action_response.py +pfruck_contabo/models/instance_rescue_action_response_data.py +pfruck_contabo/models/instance_reset_password_action_response.py +pfruck_contabo/models/instance_reset_password_action_response_data.py +pfruck_contabo/models/instance_response.py +pfruck_contabo/models/instance_restart_action_response.py +pfruck_contabo/models/instance_restart_action_response_data.py +pfruck_contabo/models/instance_shutdown_action_response.py +pfruck_contabo/models/instance_shutdown_action_response_data.py +pfruck_contabo/models/instance_start_action_response.py +pfruck_contabo/models/instance_start_action_response_data.py +pfruck_contabo/models/instance_status.py +pfruck_contabo/models/instance_stop_action_response.py +pfruck_contabo/models/instance_stop_action_response_data.py +pfruck_contabo/models/instances.py +pfruck_contabo/models/instances_actions_audit_response.py +pfruck_contabo/models/instances_actions_rescue_request.py +pfruck_contabo/models/instances_audit_response.py +pfruck_contabo/models/instances_reset_password_actions_request.py +pfruck_contabo/models/ip_config.py +pfruck_contabo/models/ip_v4.py +pfruck_contabo/models/ip_v6.py +pfruck_contabo/models/links.py +pfruck_contabo/models/list_api_permission_response.py +pfruck_contabo/models/list_applications_response.py +pfruck_contabo/models/list_assignment_audits_response.py +pfruck_contabo/models/list_assignment_response.py +pfruck_contabo/models/list_credential_response.py +pfruck_contabo/models/list_data_center_response.py +pfruck_contabo/models/list_image_response.py +pfruck_contabo/models/list_image_response_data.py +pfruck_contabo/models/list_instances_actions_audit_response.py +pfruck_contabo/models/list_instances_audit_response.py +pfruck_contabo/models/list_instances_response.py +pfruck_contabo/models/list_instances_response_data.py +pfruck_contabo/models/list_object_storage_audit_response.py +pfruck_contabo/models/list_object_storage_response.py +pfruck_contabo/models/list_private_network_audit_response.py +pfruck_contabo/models/list_private_network_response.py +pfruck_contabo/models/list_private_network_response_data.py +pfruck_contabo/models/list_role_audit_response.py +pfruck_contabo/models/list_role_response.py +pfruck_contabo/models/list_secret_audit_response.py +pfruck_contabo/models/list_secret_response.py +pfruck_contabo/models/list_snapshot_response.py +pfruck_contabo/models/list_snapshots_audit_response.py +pfruck_contabo/models/list_tag_audits_response.py +pfruck_contabo/models/list_tag_response.py +pfruck_contabo/models/list_user_audit_response.py +pfruck_contabo/models/list_user_response.py +pfruck_contabo/models/minimum_requirements.py +pfruck_contabo/models/object_storage_audit_response.py +pfruck_contabo/models/object_storage_response.py +pfruck_contabo/models/object_storages_stats_response.py +pfruck_contabo/models/object_storages_stats_response_data.py +pfruck_contabo/models/optimal_requirements.py +pfruck_contabo/models/pagination_meta.py +pfruck_contabo/models/patch_instance_request.py +pfruck_contabo/models/patch_instance_response.py +pfruck_contabo/models/patch_instance_response_data.py +pfruck_contabo/models/patch_object_storage_request.py +pfruck_contabo/models/patch_private_network_request.py +pfruck_contabo/models/patch_private_network_response.py +pfruck_contabo/models/patch_vnc_request.py +pfruck_contabo/models/permission_request.py +pfruck_contabo/models/permission_response.py +pfruck_contabo/models/private_ip_config.py +pfruck_contabo/models/private_network_audit_response.py +pfruck_contabo/models/private_network_response.py +pfruck_contabo/models/reinstall_instance_request.py +pfruck_contabo/models/reinstall_instance_response.py +pfruck_contabo/models/reinstall_instance_response_data.py +pfruck_contabo/models/resource_permissions_response.py +pfruck_contabo/models/role_audit_response.py +pfruck_contabo/models/role_response.py +pfruck_contabo/models/rollback_snapshot_response.py +pfruck_contabo/models/secret_audit_response.py +pfruck_contabo/models/secret_response.py +pfruck_contabo/models/self_links.py +pfruck_contabo/models/snapshot_response.py +pfruck_contabo/models/snapshots_audit_response.py +pfruck_contabo/models/tag_assignment_self_links.py +pfruck_contabo/models/tag_audit_response.py +pfruck_contabo/models/tag_response.py +pfruck_contabo/models/unassign_instance_private_network_response.py +pfruck_contabo/models/update_custom_image_request.py +pfruck_contabo/models/update_custom_image_response.py +pfruck_contabo/models/update_custom_image_response_data.py +pfruck_contabo/models/update_role_request.py +pfruck_contabo/models/update_role_response.py +pfruck_contabo/models/update_secret_request.py +pfruck_contabo/models/update_secret_response.py +pfruck_contabo/models/update_snapshot_request.py +pfruck_contabo/models/update_snapshot_response.py +pfruck_contabo/models/update_tag_request.py +pfruck_contabo/models/update_tag_response.py +pfruck_contabo/models/update_user_request.py +pfruck_contabo/models/update_user_response.py +pfruck_contabo/models/upgrade_auto_scaling_type.py +pfruck_contabo/models/upgrade_instance_request.py +pfruck_contabo/models/upgrade_object_storage_request.py +pfruck_contabo/models/upgrade_object_storage_response.py +pfruck_contabo/models/upgrade_object_storage_response_data.py +pfruck_contabo/models/user_audit_response.py +pfruck_contabo/models/user_is_password_set_response.py +pfruck_contabo/models/user_response.py +pfruck_contabo/models/vnc_response.py +pfruck_contabo/py.typed pfruck_contabo/rest.py +pyproject.toml requirements.txt setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_add_on_quantity_request.py -test/test_add_on_request.py -test/test_add_on_response.py -test/test_additional_ip.py -test/test_api_permissions_response.py -test/test_application_config.py -test/test_application_requirements.py -test/test_application_requirements_minimum.py -test/test_application_requirements_optimal.py -test/test_application_response.py -test/test_application_response_requirements.py -test/test_assign_instance_private_network_response.py -test/test_assign_instance_private_network_response_links.py -test/test_assigned_tag_response.py -test/test_assignment_audit_response.py -test/test_assignment_response.py -test/test_auto_scaling_type_request.py -test/test_auto_scaling_type_response.py -test/test_cancel_instance_response.py -test/test_cancel_instance_response_data.py -test/test_cancel_object_storage_response.py -test/test_cancel_object_storage_response_data.py -test/test_client_response.py -test/test_client_secret_response.py -test/test_create_assignment_response.py -test/test_create_assignment_response_links.py -test/test_create_custom_image_fail_response.py -test/test_create_custom_image_request.py -test/test_create_custom_image_response.py -test/test_create_custom_image_response_data.py -test/test_create_custom_image_response_links.py -test/test_create_instance_addons.py -test/test_create_instance_addons_extra_storage.py -test/test_create_instance_request.py -test/test_create_instance_request_add_ons.py -test/test_create_instance_response.py -test/test_create_instance_response_data.py -test/test_create_object_storage_request.py -test/test_create_object_storage_request_auto_scaling.py -test/test_create_object_storage_response.py -test/test_create_object_storage_response_data.py -test/test_create_object_storage_response_links.py -test/test_create_private_network_request.py -test/test_create_private_network_response.py -test/test_create_private_network_response_links.py -test/test_create_role_request.py -test/test_create_role_response.py -test/test_create_role_response_data.py -test/test_create_role_response_links.py -test/test_create_secret_request.py -test/test_create_secret_response.py -test/test_create_secret_response_links.py -test/test_create_snapshot_request.py -test/test_create_snapshot_response.py -test/test_create_snapshot_response_links.py -test/test_create_tag_request.py -test/test_create_tag_response.py -test/test_create_tag_response_data.py -test/test_create_tag_response_links.py -test/test_create_ticket_request.py -test/test_create_ticket_response.py -test/test_create_ticket_response_data.py -test/test_create_ticket_response_links.py -test/test_create_user_request.py -test/test_create_user_response.py -test/test_create_user_response_data.py -test/test_create_user_response_links.py -test/test_credential_data.py -test/test_custom_images_stats_response.py -test/test_custom_images_stats_response_data.py -test/test_custom_images_stats_response_links.py -test/test_data_center_response.py -test/test_extra_storage_request.py -test/test_find_assignment_response.py -test/test_find_assignment_response_links.py -test/test_find_client_response.py -test/test_find_client_response_links.py -test/test_find_credential_response.py -test/test_find_credential_response_links.py -test/test_find_image_response.py -test/test_find_instance_response.py -test/test_find_instance_response_links.py -test/test_find_object_storage_response.py -test/test_find_private_network_response.py -test/test_find_role_response.py -test/test_find_secret_response.py -test/test_find_snapshot_response.py -test/test_find_tag_response.py -test/test_find_user_is_password_set_response.py -test/test_find_user_is_password_set_response_links.py -test/test_find_user_response.py -test/test_find_vnc_response.py -test/test_find_vnc_response_links.py -test/test_firewalling_upgrade_request.py -test/test_generate_client_secret_response.py -test/test_generate_client_secret_response_links.py -test/test_image_audit_response.py -test/test_image_audit_response_data.py -test/test_image_audit_response_links.py -test/test_image_response.py -test/test_images_api.py -test/test_images_audits_api.py -test/test_instance_actions_api.py -test/test_instance_actions_audits_api.py -test/test_instance_assignment_self_links.py -test/test_instance_rescue_action_response.py -test/test_instance_rescue_action_response_data.py -test/test_instance_rescue_action_response_links.py -test/test_instance_reset_password_action_response.py -test/test_instance_reset_password_action_response_data.py -test/test_instance_reset_password_action_response_links.py -test/test_instance_response.py -test/test_instance_restart_action_response.py -test/test_instance_restart_action_response_data.py -test/test_instance_restart_action_response_links.py -test/test_instance_shutdown_action_response.py -test/test_instance_shutdown_action_response_data.py -test/test_instance_shutdown_action_response_links.py -test/test_instance_start_action_response.py -test/test_instance_start_action_response_data.py -test/test_instance_start_action_response_links.py -test/test_instance_status.py -test/test_instance_stop_action_response.py -test/test_instance_stop_action_response_data.py -test/test_instance_stop_action_response_links.py -test/test_instances.py -test/test_instances_actions_audit_response.py -test/test_instances_actions_rescue_request.py -test/test_instances_api.py -test/test_instances_audit_response.py -test/test_instances_audits_api.py -test/test_instances_reset_password_actions_request.py -test/test_internal_api.py -test/test_ip_config.py -test/test_ip_v4.py -test/test_ip_v6.py -test/test_links.py -test/test_list_api_permission_response.py -test/test_list_api_permission_response_links.py -test/test_list_applications_response.py -test/test_list_applications_response_links.py -test/test_list_assignment_audits_response.py -test/test_list_assignment_audits_response_links.py -test/test_list_assignment_response.py -test/test_list_assignment_response_links.py -test/test_list_credential_response.py -test/test_list_credential_response_links.py -test/test_list_data_center_response.py -test/test_list_data_center_response_links.py -test/test_list_image_response.py -test/test_list_image_response_data.py -test/test_list_image_response_links.py -test/test_list_instances_actions_audit_response.py -test/test_list_instances_actions_audit_response_links.py -test/test_list_instances_audit_response.py -test/test_list_instances_audit_response_links.py -test/test_list_instances_response.py -test/test_list_instances_response_data.py -test/test_list_instances_response_links.py -test/test_list_instances_response_pagination.py -test/test_list_object_storage_audit_response.py -test/test_list_object_storage_audit_response_links.py -test/test_list_object_storage_response.py -test/test_list_object_storage_response_links.py -test/test_list_private_network_audit_response.py -test/test_list_private_network_audit_response_links.py -test/test_list_private_network_response.py -test/test_list_private_network_response_data.py -test/test_list_private_network_response_links.py -test/test_list_role_audit_response.py -test/test_list_role_audit_response_links.py -test/test_list_role_response.py -test/test_list_role_response_links.py -test/test_list_secret_audit_response.py -test/test_list_secret_audit_response_links.py -test/test_list_secret_response.py -test/test_list_secret_response_links.py -test/test_list_snapshot_response.py -test/test_list_snapshot_response_links.py -test/test_list_snapshots_audit_response.py -test/test_list_snapshots_audit_response_links.py -test/test_list_tag_audits_response.py -test/test_list_tag_audits_response_links.py -test/test_list_tag_response.py -test/test_list_tag_response_links.py -test/test_list_user_audit_response.py -test/test_list_user_audit_response_links.py -test/test_list_user_response.py -test/test_list_user_response_links.py -test/test_minimum_requirements.py -test/test_object_storage_audit_response.py -test/test_object_storage_response.py -test/test_object_storage_response_auto_scaling.py -test/test_object_storages_api.py -test/test_object_storages_audits_api.py -test/test_object_storages_stats_response.py -test/test_object_storages_stats_response_data.py -test/test_object_storages_stats_response_links.py -test/test_optimal_requirements.py -test/test_pagination_meta.py -test/test_patch_instance_request.py -test/test_patch_instance_response.py -test/test_patch_instance_response_data.py -test/test_patch_instance_response_links.py -test/test_patch_object_storage_request.py -test/test_patch_private_network_request.py -test/test_patch_private_network_response.py -test/test_patch_vnc_request.py -test/test_permission_request.py -test/test_permission_response.py -test/test_private_ip_config.py -test/test_private_network_audit_response.py -test/test_private_network_response.py -test/test_private_networks_api.py -test/test_private_networks_audits_api.py -test/test_reinstall_instance_request.py -test/test_reinstall_instance_response.py -test/test_reinstall_instance_response_data.py -test/test_resource_permissions_response.py -test/test_role_audit_response.py -test/test_role_response.py -test/test_roles_api.py -test/test_roles_audits_api.py -test/test_rollback_snapshot_response.py -test/test_rollback_snapshot_response_links.py -test/test_secret_audit_response.py -test/test_secret_response.py -test/test_secrets_api.py -test/test_secrets_audits_api.py -test/test_self_links.py -test/test_snapshot_response.py -test/test_snapshots_api.py -test/test_snapshots_audit_response.py -test/test_snapshots_audits_api.py -test/test_tag_assignment_self_links.py -test/test_tag_assignments_api.py -test/test_tag_assignments_audits_api.py -test/test_tag_audit_response.py -test/test_tag_response.py -test/test_tags_api.py -test/test_tags_audits_api.py -test/test_unassign_instance_private_network_response.py -test/test_update_custom_image_request.py -test/test_update_custom_image_response.py -test/test_update_custom_image_response_data.py -test/test_update_role_request.py -test/test_update_role_response.py -test/test_update_role_response_links.py -test/test_update_secret_request.py -test/test_update_secret_response.py -test/test_update_secret_response_links.py -test/test_update_snapshot_request.py -test/test_update_snapshot_response.py -test/test_update_tag_request.py -test/test_update_tag_response.py -test/test_update_tag_response_links.py -test/test_update_user_request.py -test/test_update_user_response.py -test/test_update_user_response_links.py -test/test_upgrade_auto_scaling_type.py -test/test_upgrade_instance_request.py -test/test_upgrade_object_storage_request.py -test/test_upgrade_object_storage_request_auto_scaling.py -test/test_upgrade_object_storage_response.py -test/test_upgrade_object_storage_response_data.py -test/test_upgrade_object_storage_response_data_auto_scaling.py -test/test_upgrade_object_storage_response_links.py -test/test_user_audit_response.py -test/test_user_is_password_set_response.py -test/test_user_response.py -test/test_users_api.py -test/test_users_audits_api.py -test/test_vnc_response.py tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 358e78e..18bb418 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.1.0 \ No newline at end of file +7.5.0 diff --git a/.travis.yml b/.travis.yml index e7b63db..dbec647 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.6" - "3.7" - "3.8" - "3.9" + - "3.10" + - "3.11" + # uncomment the following if needed + #- "3.11-dev" # 3.11 development branch + #- "nightly" # nightly build # command to install dependencies install: - "pip install -r requirements.txt" diff --git a/README.md b/README.md index 0a95356..03cdafa 100644 --- a/README.md +++ b/README.md @@ -50,18 +50,10 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import pfruck_contabo +from pfruck_contabo.rest import ApiException from pprint import pprint -from pfruck_contabo.api import images_api -from pfruck_contabo.model.create_custom_image_fail_response import CreateCustomImageFailResponse -from pfruck_contabo.model.create_custom_image_request import CreateCustomImageRequest -from pfruck_contabo.model.create_custom_image_response import CreateCustomImageResponse -from pfruck_contabo.model.custom_images_stats_response import CustomImagesStatsResponse -from pfruck_contabo.model.find_image_response import FindImageResponse -from pfruck_contabo.model.list_image_response import ListImageResponse -from pfruck_contabo.model.update_custom_image_request import UpdateCustomImageRequest -from pfruck_contabo.model.update_custom_image_response import UpdateCustomImageResponse + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -75,30 +67,26 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_custom_image_request = CreateCustomImageRequest( - name="Ubuntu Custom Image", - description="Ubuntu Server 20.04.2 LTS", - url="https://example.com/image.qcow2", - os_type="Linux", - version="20.04.2", - ) # CreateCustomImageRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_custom_image_request = pfruck_contabo.CreateCustomImageRequest() # CreateCustomImageRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) try: # Provide a custom image api_response = api_instance.create_custom_image(x_request_id, create_custom_image_request, x_trace_id=x_trace_id) + print("The response of ImagesApi->create_custom_image:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except ApiException as e: print("Exception when calling ImagesApi->create_custom_image: %s\n" % e) + ``` ## Documentation for API Endpoints @@ -203,12 +191,8 @@ Class | Method | HTTP request | Description - [ApiPermissionsResponse](docs/ApiPermissionsResponse.md) - [ApplicationConfig](docs/ApplicationConfig.md) - [ApplicationRequirements](docs/ApplicationRequirements.md) - - [ApplicationRequirementsMinimum](docs/ApplicationRequirementsMinimum.md) - - [ApplicationRequirementsOptimal](docs/ApplicationRequirementsOptimal.md) - [ApplicationResponse](docs/ApplicationResponse.md) - - [ApplicationResponseRequirements](docs/ApplicationResponseRequirements.md) - [AssignInstancePrivateNetworkResponse](docs/AssignInstancePrivateNetworkResponse.md) - - [AssignInstancePrivateNetworkResponseLinks](docs/AssignInstancePrivateNetworkResponseLinks.md) - [AssignedTagResponse](docs/AssignedTagResponse.md) - [AssignmentAuditResponse](docs/AssignmentAuditResponse.md) - [AssignmentResponse](docs/AssignmentResponse.md) @@ -221,63 +205,45 @@ Class | Method | HTTP request | Description - [ClientResponse](docs/ClientResponse.md) - [ClientSecretResponse](docs/ClientSecretResponse.md) - [CreateAssignmentResponse](docs/CreateAssignmentResponse.md) - - [CreateAssignmentResponseLinks](docs/CreateAssignmentResponseLinks.md) - [CreateCustomImageFailResponse](docs/CreateCustomImageFailResponse.md) - [CreateCustomImageRequest](docs/CreateCustomImageRequest.md) - [CreateCustomImageResponse](docs/CreateCustomImageResponse.md) - [CreateCustomImageResponseData](docs/CreateCustomImageResponseData.md) - - [CreateCustomImageResponseLinks](docs/CreateCustomImageResponseLinks.md) - [CreateInstanceAddons](docs/CreateInstanceAddons.md) - - [CreateInstanceAddonsExtraStorage](docs/CreateInstanceAddonsExtraStorage.md) - [CreateInstanceRequest](docs/CreateInstanceRequest.md) - - [CreateInstanceRequestAddOns](docs/CreateInstanceRequestAddOns.md) - [CreateInstanceResponse](docs/CreateInstanceResponse.md) - [CreateInstanceResponseData](docs/CreateInstanceResponseData.md) - [CreateObjectStorageRequest](docs/CreateObjectStorageRequest.md) - - [CreateObjectStorageRequestAutoScaling](docs/CreateObjectStorageRequestAutoScaling.md) - [CreateObjectStorageResponse](docs/CreateObjectStorageResponse.md) - [CreateObjectStorageResponseData](docs/CreateObjectStorageResponseData.md) - - [CreateObjectStorageResponseLinks](docs/CreateObjectStorageResponseLinks.md) - [CreatePrivateNetworkRequest](docs/CreatePrivateNetworkRequest.md) - [CreatePrivateNetworkResponse](docs/CreatePrivateNetworkResponse.md) - - [CreatePrivateNetworkResponseLinks](docs/CreatePrivateNetworkResponseLinks.md) - [CreateRoleRequest](docs/CreateRoleRequest.md) - [CreateRoleResponse](docs/CreateRoleResponse.md) - [CreateRoleResponseData](docs/CreateRoleResponseData.md) - - [CreateRoleResponseLinks](docs/CreateRoleResponseLinks.md) - [CreateSecretRequest](docs/CreateSecretRequest.md) - [CreateSecretResponse](docs/CreateSecretResponse.md) - - [CreateSecretResponseLinks](docs/CreateSecretResponseLinks.md) - [CreateSnapshotRequest](docs/CreateSnapshotRequest.md) - [CreateSnapshotResponse](docs/CreateSnapshotResponse.md) - - [CreateSnapshotResponseLinks](docs/CreateSnapshotResponseLinks.md) - [CreateTagRequest](docs/CreateTagRequest.md) - [CreateTagResponse](docs/CreateTagResponse.md) - [CreateTagResponseData](docs/CreateTagResponseData.md) - - [CreateTagResponseLinks](docs/CreateTagResponseLinks.md) - [CreateTicketRequest](docs/CreateTicketRequest.md) - [CreateTicketResponse](docs/CreateTicketResponse.md) - [CreateTicketResponseData](docs/CreateTicketResponseData.md) - - [CreateTicketResponseLinks](docs/CreateTicketResponseLinks.md) - [CreateUserRequest](docs/CreateUserRequest.md) - [CreateUserResponse](docs/CreateUserResponse.md) - [CreateUserResponseData](docs/CreateUserResponseData.md) - - [CreateUserResponseLinks](docs/CreateUserResponseLinks.md) - [CredentialData](docs/CredentialData.md) - [CustomImagesStatsResponse](docs/CustomImagesStatsResponse.md) - [CustomImagesStatsResponseData](docs/CustomImagesStatsResponseData.md) - - [CustomImagesStatsResponseLinks](docs/CustomImagesStatsResponseLinks.md) - [DataCenterResponse](docs/DataCenterResponse.md) - [ExtraStorageRequest](docs/ExtraStorageRequest.md) - [FindAssignmentResponse](docs/FindAssignmentResponse.md) - - [FindAssignmentResponseLinks](docs/FindAssignmentResponseLinks.md) - [FindClientResponse](docs/FindClientResponse.md) - - [FindClientResponseLinks](docs/FindClientResponseLinks.md) - [FindCredentialResponse](docs/FindCredentialResponse.md) - - [FindCredentialResponseLinks](docs/FindCredentialResponseLinks.md) - [FindImageResponse](docs/FindImageResponse.md) - [FindInstanceResponse](docs/FindInstanceResponse.md) - - [FindInstanceResponseLinks](docs/FindInstanceResponseLinks.md) - [FindObjectStorageResponse](docs/FindObjectStorageResponse.md) - [FindPrivateNetworkResponse](docs/FindPrivateNetworkResponse.md) - [FindRoleResponse](docs/FindRoleResponse.md) @@ -285,38 +251,28 @@ Class | Method | HTTP request | Description - [FindSnapshotResponse](docs/FindSnapshotResponse.md) - [FindTagResponse](docs/FindTagResponse.md) - [FindUserIsPasswordSetResponse](docs/FindUserIsPasswordSetResponse.md) - - [FindUserIsPasswordSetResponseLinks](docs/FindUserIsPasswordSetResponseLinks.md) - [FindUserResponse](docs/FindUserResponse.md) - [FindVncResponse](docs/FindVncResponse.md) - - [FindVncResponseLinks](docs/FindVncResponseLinks.md) - [FirewallingUpgradeRequest](docs/FirewallingUpgradeRequest.md) - [GenerateClientSecretResponse](docs/GenerateClientSecretResponse.md) - - [GenerateClientSecretResponseLinks](docs/GenerateClientSecretResponseLinks.md) - [ImageAuditResponse](docs/ImageAuditResponse.md) - [ImageAuditResponseData](docs/ImageAuditResponseData.md) - - [ImageAuditResponseLinks](docs/ImageAuditResponseLinks.md) - [ImageResponse](docs/ImageResponse.md) - [InstanceAssignmentSelfLinks](docs/InstanceAssignmentSelfLinks.md) - [InstanceRescueActionResponse](docs/InstanceRescueActionResponse.md) - [InstanceRescueActionResponseData](docs/InstanceRescueActionResponseData.md) - - [InstanceRescueActionResponseLinks](docs/InstanceRescueActionResponseLinks.md) - [InstanceResetPasswordActionResponse](docs/InstanceResetPasswordActionResponse.md) - [InstanceResetPasswordActionResponseData](docs/InstanceResetPasswordActionResponseData.md) - - [InstanceResetPasswordActionResponseLinks](docs/InstanceResetPasswordActionResponseLinks.md) - [InstanceResponse](docs/InstanceResponse.md) - [InstanceRestartActionResponse](docs/InstanceRestartActionResponse.md) - [InstanceRestartActionResponseData](docs/InstanceRestartActionResponseData.md) - - [InstanceRestartActionResponseLinks](docs/InstanceRestartActionResponseLinks.md) - [InstanceShutdownActionResponse](docs/InstanceShutdownActionResponse.md) - [InstanceShutdownActionResponseData](docs/InstanceShutdownActionResponseData.md) - - [InstanceShutdownActionResponseLinks](docs/InstanceShutdownActionResponseLinks.md) - [InstanceStartActionResponse](docs/InstanceStartActionResponse.md) - [InstanceStartActionResponseData](docs/InstanceStartActionResponseData.md) - - [InstanceStartActionResponseLinks](docs/InstanceStartActionResponseLinks.md) - [InstanceStatus](docs/InstanceStatus.md) - [InstanceStopActionResponse](docs/InstanceStopActionResponse.md) - [InstanceStopActionResponseData](docs/InstanceStopActionResponseData.md) - - [InstanceStopActionResponseLinks](docs/InstanceStopActionResponseLinks.md) - [Instances](docs/Instances.md) - [InstancesActionsAuditResponse](docs/InstancesActionsAuditResponse.md) - [InstancesActionsRescueRequest](docs/InstancesActionsRescueRequest.md) @@ -327,70 +283,42 @@ Class | Method | HTTP request | Description - [IpV6](docs/IpV6.md) - [Links](docs/Links.md) - [ListApiPermissionResponse](docs/ListApiPermissionResponse.md) - - [ListApiPermissionResponseLinks](docs/ListApiPermissionResponseLinks.md) - [ListApplicationsResponse](docs/ListApplicationsResponse.md) - - [ListApplicationsResponseLinks](docs/ListApplicationsResponseLinks.md) - [ListAssignmentAuditsResponse](docs/ListAssignmentAuditsResponse.md) - - [ListAssignmentAuditsResponseLinks](docs/ListAssignmentAuditsResponseLinks.md) - [ListAssignmentResponse](docs/ListAssignmentResponse.md) - - [ListAssignmentResponseLinks](docs/ListAssignmentResponseLinks.md) - [ListCredentialResponse](docs/ListCredentialResponse.md) - - [ListCredentialResponseLinks](docs/ListCredentialResponseLinks.md) - [ListDataCenterResponse](docs/ListDataCenterResponse.md) - - [ListDataCenterResponseLinks](docs/ListDataCenterResponseLinks.md) - [ListImageResponse](docs/ListImageResponse.md) - [ListImageResponseData](docs/ListImageResponseData.md) - - [ListImageResponseLinks](docs/ListImageResponseLinks.md) - [ListInstancesActionsAuditResponse](docs/ListInstancesActionsAuditResponse.md) - - [ListInstancesActionsAuditResponseLinks](docs/ListInstancesActionsAuditResponseLinks.md) - [ListInstancesAuditResponse](docs/ListInstancesAuditResponse.md) - - [ListInstancesAuditResponseLinks](docs/ListInstancesAuditResponseLinks.md) - [ListInstancesResponse](docs/ListInstancesResponse.md) - [ListInstancesResponseData](docs/ListInstancesResponseData.md) - - [ListInstancesResponseLinks](docs/ListInstancesResponseLinks.md) - - [ListInstancesResponsePagination](docs/ListInstancesResponsePagination.md) - [ListObjectStorageAuditResponse](docs/ListObjectStorageAuditResponse.md) - - [ListObjectStorageAuditResponseLinks](docs/ListObjectStorageAuditResponseLinks.md) - [ListObjectStorageResponse](docs/ListObjectStorageResponse.md) - - [ListObjectStorageResponseLinks](docs/ListObjectStorageResponseLinks.md) - [ListPrivateNetworkAuditResponse](docs/ListPrivateNetworkAuditResponse.md) - - [ListPrivateNetworkAuditResponseLinks](docs/ListPrivateNetworkAuditResponseLinks.md) - [ListPrivateNetworkResponse](docs/ListPrivateNetworkResponse.md) - [ListPrivateNetworkResponseData](docs/ListPrivateNetworkResponseData.md) - - [ListPrivateNetworkResponseLinks](docs/ListPrivateNetworkResponseLinks.md) - [ListRoleAuditResponse](docs/ListRoleAuditResponse.md) - - [ListRoleAuditResponseLinks](docs/ListRoleAuditResponseLinks.md) - [ListRoleResponse](docs/ListRoleResponse.md) - - [ListRoleResponseLinks](docs/ListRoleResponseLinks.md) - [ListSecretAuditResponse](docs/ListSecretAuditResponse.md) - - [ListSecretAuditResponseLinks](docs/ListSecretAuditResponseLinks.md) - [ListSecretResponse](docs/ListSecretResponse.md) - - [ListSecretResponseLinks](docs/ListSecretResponseLinks.md) - [ListSnapshotResponse](docs/ListSnapshotResponse.md) - - [ListSnapshotResponseLinks](docs/ListSnapshotResponseLinks.md) - [ListSnapshotsAuditResponse](docs/ListSnapshotsAuditResponse.md) - - [ListSnapshotsAuditResponseLinks](docs/ListSnapshotsAuditResponseLinks.md) - [ListTagAuditsResponse](docs/ListTagAuditsResponse.md) - - [ListTagAuditsResponseLinks](docs/ListTagAuditsResponseLinks.md) - [ListTagResponse](docs/ListTagResponse.md) - - [ListTagResponseLinks](docs/ListTagResponseLinks.md) - [ListUserAuditResponse](docs/ListUserAuditResponse.md) - - [ListUserAuditResponseLinks](docs/ListUserAuditResponseLinks.md) - [ListUserResponse](docs/ListUserResponse.md) - - [ListUserResponseLinks](docs/ListUserResponseLinks.md) - [MinimumRequirements](docs/MinimumRequirements.md) - [ObjectStorageAuditResponse](docs/ObjectStorageAuditResponse.md) - [ObjectStorageResponse](docs/ObjectStorageResponse.md) - - [ObjectStorageResponseAutoScaling](docs/ObjectStorageResponseAutoScaling.md) - [ObjectStoragesStatsResponse](docs/ObjectStoragesStatsResponse.md) - [ObjectStoragesStatsResponseData](docs/ObjectStoragesStatsResponseData.md) - - [ObjectStoragesStatsResponseLinks](docs/ObjectStoragesStatsResponseLinks.md) - [OptimalRequirements](docs/OptimalRequirements.md) - [PaginationMeta](docs/PaginationMeta.md) - [PatchInstanceRequest](docs/PatchInstanceRequest.md) - [PatchInstanceResponse](docs/PatchInstanceResponse.md) - [PatchInstanceResponseData](docs/PatchInstanceResponseData.md) - - [PatchInstanceResponseLinks](docs/PatchInstanceResponseLinks.md) - [PatchObjectStorageRequest](docs/PatchObjectStorageRequest.md) - [PatchPrivateNetworkRequest](docs/PatchPrivateNetworkRequest.md) - [PatchPrivateNetworkResponse](docs/PatchPrivateNetworkResponse.md) @@ -407,7 +335,6 @@ Class | Method | HTTP request | Description - [RoleAuditResponse](docs/RoleAuditResponse.md) - [RoleResponse](docs/RoleResponse.md) - [RollbackSnapshotResponse](docs/RollbackSnapshotResponse.md) - - [RollbackSnapshotResponseLinks](docs/RollbackSnapshotResponseLinks.md) - [SecretAuditResponse](docs/SecretAuditResponse.md) - [SecretResponse](docs/SecretResponse.md) - [SelfLinks](docs/SelfLinks.md) @@ -422,36 +349,32 @@ Class | Method | HTTP request | Description - [UpdateCustomImageResponseData](docs/UpdateCustomImageResponseData.md) - [UpdateRoleRequest](docs/UpdateRoleRequest.md) - [UpdateRoleResponse](docs/UpdateRoleResponse.md) - - [UpdateRoleResponseLinks](docs/UpdateRoleResponseLinks.md) - [UpdateSecretRequest](docs/UpdateSecretRequest.md) - [UpdateSecretResponse](docs/UpdateSecretResponse.md) - - [UpdateSecretResponseLinks](docs/UpdateSecretResponseLinks.md) - [UpdateSnapshotRequest](docs/UpdateSnapshotRequest.md) - [UpdateSnapshotResponse](docs/UpdateSnapshotResponse.md) - [UpdateTagRequest](docs/UpdateTagRequest.md) - [UpdateTagResponse](docs/UpdateTagResponse.md) - - [UpdateTagResponseLinks](docs/UpdateTagResponseLinks.md) - [UpdateUserRequest](docs/UpdateUserRequest.md) - [UpdateUserResponse](docs/UpdateUserResponse.md) - - [UpdateUserResponseLinks](docs/UpdateUserResponseLinks.md) - [UpgradeAutoScalingType](docs/UpgradeAutoScalingType.md) - [UpgradeInstanceRequest](docs/UpgradeInstanceRequest.md) - [UpgradeObjectStorageRequest](docs/UpgradeObjectStorageRequest.md) - - [UpgradeObjectStorageRequestAutoScaling](docs/UpgradeObjectStorageRequestAutoScaling.md) - [UpgradeObjectStorageResponse](docs/UpgradeObjectStorageResponse.md) - [UpgradeObjectStorageResponseData](docs/UpgradeObjectStorageResponseData.md) - - [UpgradeObjectStorageResponseDataAutoScaling](docs/UpgradeObjectStorageResponseDataAutoScaling.md) - - [UpgradeObjectStorageResponseLinks](docs/UpgradeObjectStorageResponseLinks.md) - [UserAuditResponse](docs/UserAuditResponse.md) - [UserIsPasswordSetResponse](docs/UserIsPasswordSetResponse.md) - [UserResponse](docs/UserResponse.md) - [VncResponse](docs/VncResponse.md) + ## Documentation For Authorization -## bearer +Authentication schemes defined for the API: + +### bearer - **Type**: Bearer authentication (JWT) @@ -461,22 +384,3 @@ Class | Method | HTTP request | Description support@contabo.com -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in pfruck_contabo.apis and pfruck_contabo.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from pfruck_contabo.api.default_api import DefaultApi` -- `from pfruck_contabo.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import pfruck_contabo -from pfruck_contabo.apis import * -from pfruck_contabo.models import * -``` - diff --git a/docs/AddOnQuantityRequest.md b/docs/AddOnQuantityRequest.md index 9bb36d0..78c6c94 100644 --- a/docs/AddOnQuantityRequest.md +++ b/docs/AddOnQuantityRequest.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **quantity** | **int** | The number of Addons you wish to aquire. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.add_on_quantity_request import AddOnQuantityRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AddOnQuantityRequest from a JSON string +add_on_quantity_request_instance = AddOnQuantityRequest.from_json(json) +# print the JSON string representation of the object +print(AddOnQuantityRequest.to_json()) + +# convert the object into a dict +add_on_quantity_request_dict = add_on_quantity_request_instance.to_dict() +# create an instance of AddOnQuantityRequest from a dict +add_on_quantity_request_from_dict = AddOnQuantityRequest.from_dict(add_on_quantity_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AddOnRequest.md b/docs/AddOnRequest.md index 81eefe4..20a4ed7 100644 --- a/docs/AddOnRequest.md +++ b/docs/AddOnRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Id of the Addon. Please refer to list [here](https://contabo.com/en/product-list/?show_ids=true). | **quantity** | **int** | The number of Addons you wish to aquire. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.add_on_request import AddOnRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AddOnRequest from a JSON string +add_on_request_instance = AddOnRequest.from_json(json) +# print the JSON string representation of the object +print(AddOnRequest.to_json()) + +# convert the object into a dict +add_on_request_dict = add_on_request_instance.to_dict() +# create an instance of AddOnRequest from a dict +add_on_request_from_dict = AddOnRequest.from_dict(add_on_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AddOnResponse.md b/docs/AddOnResponse.md index 9fd4172..e159b35 100644 --- a/docs/AddOnResponse.md +++ b/docs/AddOnResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Id of the Addon. Please refer to list [here](https://contabo.com/en/product-list/?show_ids=true). | **quantity** | **int** | The number of Addons you wish to aquire. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.add_on_response import AddOnResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AddOnResponse from a JSON string +add_on_response_instance = AddOnResponse.from_json(json) +# print the JSON string representation of the object +print(AddOnResponse.to_json()) + +# convert the object into a dict +add_on_response_dict = add_on_response_instance.to_dict() +# create an instance of AddOnResponse from a dict +add_on_response_from_dict = AddOnResponse.from_dict(add_on_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AdditionalIp.md b/docs/AdditionalIp.md index 5b10087..89cfd34 100644 --- a/docs/AdditionalIp.md +++ b/docs/AdditionalIp.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **v4** | [**IpV4**](IpV4.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.additional_ip import AdditionalIp + +# TODO update the JSON string below +json = "{}" +# create an instance of AdditionalIp from a JSON string +additional_ip_instance = AdditionalIp.from_json(json) +# print the JSON string representation of the object +print(AdditionalIp.to_json()) + +# convert the object into a dict +additional_ip_dict = additional_ip_instance.to_dict() +# create an instance of AdditionalIp from a dict +additional_ip_from_dict = AdditionalIp.from_dict(additional_ip_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApiPermissionsResponse.md b/docs/ApiPermissionsResponse.md index 51e3f9c..f2a31dd 100644 --- a/docs/ApiPermissionsResponse.md +++ b/docs/ApiPermissionsResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_name** | **str** | API endpoint. In order to get a list availbale api enpoints please refer to the GET api-permissions endpoint. | -**actions** | **[str]** | Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**actions** | **List[str]** | Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints. | + +## Example + +```python +from pfruck_contabo.models.api_permissions_response import ApiPermissionsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiPermissionsResponse from a JSON string +api_permissions_response_instance = ApiPermissionsResponse.from_json(json) +# print the JSON string representation of the object +print(ApiPermissionsResponse.to_json()) +# convert the object into a dict +api_permissions_response_dict = api_permissions_response_instance.to_dict() +# create an instance of ApiPermissionsResponse from a dict +api_permissions_response_from_dict = ApiPermissionsResponse.from_dict(api_permissions_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApplicationConfig.md b/docs/ApplicationConfig.md index dcf61b9..0aedb33 100644 --- a/docs/ApplicationConfig.md +++ b/docs/ApplicationConfig.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **image_id** | **str** | Image ID | **user_data_id** | **str** | User Data ID | **user_data** | **str** | [Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.application_config import ApplicationConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of ApplicationConfig from a JSON string +application_config_instance = ApplicationConfig.from_json(json) +# print the JSON string representation of the object +print(ApplicationConfig.to_json()) + +# convert the object into a dict +application_config_dict = application_config_instance.to_dict() +# create an instance of ApplicationConfig from a dict +application_config_from_dict = ApplicationConfig.from_dict(application_config_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApplicationRequirements.md b/docs/ApplicationRequirements.md index 6c6945b..21e5752 100644 --- a/docs/ApplicationRequirements.md +++ b/docs/ApplicationRequirements.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**minimum** | [**ApplicationRequirementsMinimum**](ApplicationRequirementsMinimum.md) | | [optional] -**optimal** | [**ApplicationRequirementsOptimal**](ApplicationRequirementsOptimal.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**minimum** | [**MinimumRequirements**](MinimumRequirements.md) | Application minimum requirements | [optional] +**optimal** | [**OptimalRequirements**](OptimalRequirements.md) | Application optimal requirements | [optional] + +## Example + +```python +from pfruck_contabo.models.application_requirements import ApplicationRequirements + +# TODO update the JSON string below +json = "{}" +# create an instance of ApplicationRequirements from a JSON string +application_requirements_instance = ApplicationRequirements.from_json(json) +# print the JSON string representation of the object +print(ApplicationRequirements.to_json()) +# convert the object into a dict +application_requirements_dict = application_requirements_instance.to_dict() +# create an instance of ApplicationRequirements from a dict +application_requirements_from_dict = ApplicationRequirements.from_dict(application_requirements_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ApplicationResponse.md b/docs/ApplicationResponse.md index 60f99d2..6cb7708 100644 --- a/docs/ApplicationResponse.md +++ b/docs/ApplicationResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_id** | **str** | Application ID | @@ -10,10 +11,26 @@ Name | Type | Description | Notes **name** | **str** | Application Name | **description** | **str** | Application Description | **type** | **str** | Application type | -**application_config** | [**[ApplicationConfig]**](ApplicationConfig.md) | Application Config | -**requirements** | [**ApplicationResponseRequirements**](ApplicationResponseRequirements.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**application_config** | [**List[ApplicationConfig]**](ApplicationConfig.md) | Application Config | +**requirements** | [**ApplicationRequirements**](ApplicationRequirements.md) | Application Requirements | + +## Example + +```python +from pfruck_contabo.models.application_response import ApplicationResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApplicationResponse from a JSON string +application_response_instance = ApplicationResponse.from_json(json) +# print the JSON string representation of the object +print(ApplicationResponse.to_json()) +# convert the object into a dict +application_response_dict = application_response_instance.to_dict() +# create an instance of ApplicationResponse from a dict +application_response_from_dict = ApplicationResponse.from_dict(application_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssignInstancePrivateNetworkResponse.md b/docs/AssignInstancePrivateNetworkResponse.md index 9e70aa5..c063ff6 100644 --- a/docs/AssignInstancePrivateNetworkResponse.md +++ b/docs/AssignInstancePrivateNetworkResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**AssignInstancePrivateNetworkResponseLinks**](AssignInstancePrivateNetworkResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**InstanceAssignmentSelfLinks**](InstanceAssignmentSelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignInstancePrivateNetworkResponse from a JSON string +assign_instance_private_network_response_instance = AssignInstancePrivateNetworkResponse.from_json(json) +# print the JSON string representation of the object +print(AssignInstancePrivateNetworkResponse.to_json()) +# convert the object into a dict +assign_instance_private_network_response_dict = assign_instance_private_network_response_instance.to_dict() +# create an instance of AssignInstancePrivateNetworkResponse from a dict +assign_instance_private_network_response_from_dict = AssignInstancePrivateNetworkResponse.from_dict(assign_instance_private_network_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssignedTagResponse.md b/docs/AssignedTagResponse.md index bf6500a..7cc5f47 100644 --- a/docs/AssignedTagResponse.md +++ b/docs/AssignedTagResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tag_id** | **float** | Tag's id | **tag_name** | **str** | Tag's name | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.assigned_tag_response import AssignedTagResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignedTagResponse from a JSON string +assigned_tag_response_instance = AssignedTagResponse.from_json(json) +# print the JSON string representation of the object +print(AssignedTagResponse.to_json()) + +# convert the object into a dict +assigned_tag_response_dict = assigned_tag_response_instance.to_dict() +# create an instance of AssignedTagResponse from a dict +assigned_tag_response_from_dict = AssignedTagResponse.from_dict(assigned_tag_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssignmentAuditResponse.md b/docs/AssignmentAuditResponse.md index 111439d..566ba28 100644 --- a/docs/AssignmentAuditResponse.md +++ b/docs/AssignmentAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -16,9 +17,25 @@ Name | Type | Description | Notes **username** | **str** | User Full Name | **request_id** | **str** | Request ID | **trace_id** | **str** | Trace ID | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Changes made for a specific Tag | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | Changes made for a specific Tag | [optional] + +## Example + +```python +from pfruck_contabo.models.assignment_audit_response import AssignmentAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentAuditResponse from a JSON string +assignment_audit_response_instance = AssignmentAuditResponse.from_json(json) +# print the JSON string representation of the object +print(AssignmentAuditResponse.to_json()) +# convert the object into a dict +assignment_audit_response_dict = assignment_audit_response_instance.to_dict() +# create an instance of AssignmentAuditResponse from a dict +assignment_audit_response_from_dict = AssignmentAuditResponse.from_dict(assignment_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AssignmentResponse.md b/docs/AssignmentResponse.md index 70dd334..6c97fe7 100644 --- a/docs/AssignmentResponse.md +++ b/docs/AssignmentResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -11,8 +12,24 @@ Name | Type | Description | Notes **resource_type** | **str** | Resource type. Resource type is one of `instance|image|object-storage`. | **resource_id** | **str** | Resource id | **resource_name** | **str** | Resource name | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.assignment_response import AssignmentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentResponse from a JSON string +assignment_response_instance = AssignmentResponse.from_json(json) +# print the JSON string representation of the object +print(AssignmentResponse.to_json()) + +# convert the object into a dict +assignment_response_dict = assignment_response_instance.to_dict() +# create an instance of AssignmentResponse from a dict +assignment_response_from_dict = AssignmentResponse.from_dict(assignment_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AutoScalingTypeRequest.md b/docs/AutoScalingTypeRequest.md index 03f27df..b3a1bb6 100644 --- a/docs/AutoScalingTypeRequest.md +++ b/docs/AutoScalingTypeRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **state** | **str** | State of the autoscaling for the current object storage. | **size_limit_tb** | **float** | Autoscaling size limit for the current object storage. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.auto_scaling_type_request import AutoScalingTypeRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AutoScalingTypeRequest from a JSON string +auto_scaling_type_request_instance = AutoScalingTypeRequest.from_json(json) +# print the JSON string representation of the object +print(AutoScalingTypeRequest.to_json()) + +# convert the object into a dict +auto_scaling_type_request_dict = auto_scaling_type_request_instance.to_dict() +# create an instance of AutoScalingTypeRequest from a dict +auto_scaling_type_request_from_dict = AutoScalingTypeRequest.from_dict(auto_scaling_type_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AutoScalingTypeResponse.md b/docs/AutoScalingTypeResponse.md index 4ce82a7..5bc9c6e 100644 --- a/docs/AutoScalingTypeResponse.md +++ b/docs/AutoScalingTypeResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **state** | **str** | State of the autoscaling for the current object storage. | **size_limit_tb** | **float** | Autoscaling size limit for the current object storage. | **error_message** | **str** | Error message | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.auto_scaling_type_response import AutoScalingTypeResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AutoScalingTypeResponse from a JSON string +auto_scaling_type_response_instance = AutoScalingTypeResponse.from_json(json) +# print the JSON string representation of the object +print(AutoScalingTypeResponse.to_json()) + +# convert the object into a dict +auto_scaling_type_response_dict = auto_scaling_type_response_instance.to_dict() +# create an instance of AutoScalingTypeResponse from a dict +auto_scaling_type_response_from_dict = AutoScalingTypeResponse.from_dict(auto_scaling_type_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CancelInstanceResponse.md b/docs/CancelInstanceResponse.md index 550d3d3..b6ff826 100644 --- a/docs/CancelInstanceResponse.md +++ b/docs/CancelInstanceResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CancelInstanceResponseData]**](CancelInstanceResponseData.md) | | -**links** | [**PatchInstanceResponseLinks**](PatchInstanceResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CancelInstanceResponseData]**](CancelInstanceResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.cancel_instance_response import CancelInstanceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CancelInstanceResponse from a JSON string +cancel_instance_response_instance = CancelInstanceResponse.from_json(json) +# print the JSON string representation of the object +print(CancelInstanceResponse.to_json()) +# convert the object into a dict +cancel_instance_response_dict = cancel_instance_response_instance.to_dict() +# create an instance of CancelInstanceResponse from a dict +cancel_instance_response_from_dict = CancelInstanceResponse.from_dict(cancel_instance_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CancelInstanceResponseData.md b/docs/CancelInstanceResponseData.md index d6b5763..ccd2faa 100644 --- a/docs/CancelInstanceResponseData.md +++ b/docs/CancelInstanceResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Instance's id | **cancel_date** | **date** | The date on which the instance will be cancelled | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.cancel_instance_response_data import CancelInstanceResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CancelInstanceResponseData from a JSON string +cancel_instance_response_data_instance = CancelInstanceResponseData.from_json(json) +# print the JSON string representation of the object +print(CancelInstanceResponseData.to_json()) + +# convert the object into a dict +cancel_instance_response_data_dict = cancel_instance_response_data_instance.to_dict() +# create an instance of CancelInstanceResponseData from a dict +cancel_instance_response_data_from_dict = CancelInstanceResponseData.from_dict(cancel_instance_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CancelObjectStorageResponse.md b/docs/CancelObjectStorageResponse.md index 390240b..6abcd1a 100644 --- a/docs/CancelObjectStorageResponse.md +++ b/docs/CancelObjectStorageResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**UpgradeObjectStorageResponseLinks**](UpgradeObjectStorageResponseLinks.md) | | -**data** | [**[CancelObjectStorageResponseData]**](CancelObjectStorageResponseData.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | +**data** | [**List[CancelObjectStorageResponseData]**](CancelObjectStorageResponseData.md) | | + +## Example + +```python +from pfruck_contabo.models.cancel_object_storage_response import CancelObjectStorageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CancelObjectStorageResponse from a JSON string +cancel_object_storage_response_instance = CancelObjectStorageResponse.from_json(json) +# print the JSON string representation of the object +print(CancelObjectStorageResponse.to_json()) +# convert the object into a dict +cancel_object_storage_response_dict = cancel_object_storage_response_instance.to_dict() +# create an instance of CancelObjectStorageResponse from a dict +cancel_object_storage_response_from_dict = CancelObjectStorageResponse.from_dict(cancel_object_storage_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CancelObjectStorageResponseData.md b/docs/CancelObjectStorageResponseData.md index 23a9aff..1f17209 100644 --- a/docs/CancelObjectStorageResponseData.md +++ b/docs/CancelObjectStorageResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -9,8 +10,24 @@ Name | Type | Description | Notes **object_storage_id** | **str** | Object Storage id | **cancel_date** | **date** | Cancellation date for object storage. | **display_name** | **str** | Display name for object storage. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.cancel_object_storage_response_data import CancelObjectStorageResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CancelObjectStorageResponseData from a JSON string +cancel_object_storage_response_data_instance = CancelObjectStorageResponseData.from_json(json) +# print the JSON string representation of the object +print(CancelObjectStorageResponseData.to_json()) + +# convert the object into a dict +cancel_object_storage_response_data_dict = cancel_object_storage_response_data_instance.to_dict() +# create an instance of CancelObjectStorageResponseData from a dict +cancel_object_storage_response_data_from_dict = CancelObjectStorageResponseData.from_dict(cancel_object_storage_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ClientResponse.md b/docs/ClientResponse.md index 06b0947..8ec1710 100644 --- a/docs/ClientResponse.md +++ b/docs/ClientResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -9,8 +10,24 @@ Name | Type | Description | Notes **id** | **str** | Client's id | **client_id** | **str** | IDM client id | **secret** | **str** | IDM client secret | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.client_response import ClientResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ClientResponse from a JSON string +client_response_instance = ClientResponse.from_json(json) +# print the JSON string representation of the object +print(ClientResponse.to_json()) + +# convert the object into a dict +client_response_dict = client_response_instance.to_dict() +# create an instance of ClientResponse from a dict +client_response_from_dict = ClientResponse.from_dict(client_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ClientSecretResponse.md b/docs/ClientSecretResponse.md index 16d4c64..9aef249 100644 --- a/docs/ClientSecretResponse.md +++ b/docs/ClientSecretResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **secret** | **str** | IDM client secret | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.client_secret_response import ClientSecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ClientSecretResponse from a JSON string +client_secret_response_instance = ClientSecretResponse.from_json(json) +# print the JSON string representation of the object +print(ClientSecretResponse.to_json()) + +# convert the object into a dict +client_secret_response_dict = client_secret_response_instance.to_dict() +# create an instance of ClientSecretResponse from a dict +client_secret_response_from_dict = ClientSecretResponse.from_dict(client_secret_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateAssignmentResponse.md b/docs/CreateAssignmentResponse.md index 59aae20..e432396 100644 --- a/docs/CreateAssignmentResponse.md +++ b/docs/CreateAssignmentResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**CreateAssignmentResponseLinks**](CreateAssignmentResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**TagAssignmentSelfLinks**](TagAssignmentSelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.create_assignment_response import CreateAssignmentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateAssignmentResponse from a JSON string +create_assignment_response_instance = CreateAssignmentResponse.from_json(json) +# print the JSON string representation of the object +print(CreateAssignmentResponse.to_json()) +# convert the object into a dict +create_assignment_response_dict = create_assignment_response_instance.to_dict() +# create an instance of CreateAssignmentResponse from a dict +create_assignment_response_from_dict = CreateAssignmentResponse.from_dict(create_assignment_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCustomImageFailResponse.md b/docs/CreateCustomImageFailResponse.md index 2bc6b5d..a254455 100644 --- a/docs/CreateCustomImageFailResponse.md +++ b/docs/CreateCustomImageFailResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | Unsupported Media Type: Please provide a direct link to an .iso or .qcow2 image. | **status_code** | **int** | statuscode:415 | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_custom_image_fail_response import CreateCustomImageFailResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCustomImageFailResponse from a JSON string +create_custom_image_fail_response_instance = CreateCustomImageFailResponse.from_json(json) +# print the JSON string representation of the object +print(CreateCustomImageFailResponse.to_json()) + +# convert the object into a dict +create_custom_image_fail_response_dict = create_custom_image_fail_response_instance.to_dict() +# create an instance of CreateCustomImageFailResponse from a dict +create_custom_image_fail_response_from_dict = CreateCustomImageFailResponse.from_dict(create_custom_image_fail_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCustomImageRequest.md b/docs/CreateCustomImageRequest.md index 1ec5c33..36ac0b8 100644 --- a/docs/CreateCustomImageRequest.md +++ b/docs/CreateCustomImageRequest.md @@ -2,15 +2,32 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Image Name | +**description** | **str** | Image Description | [optional] **url** | **str** | URL from where the image has been downloaded / provided. | **os_type** | **str** | Provided type of operating system (OS). Please specify `Windows` for MS Windows and `Linux` for other OS. Specifying wrong OS type may lead to disfunctional cloud instance. | **version** | **str** | Version number to distinguish the contents of an image. Could be the version of the operating system for example. | -**description** | **str** | Image Description | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_custom_image_request import CreateCustomImageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCustomImageRequest from a JSON string +create_custom_image_request_instance = CreateCustomImageRequest.from_json(json) +# print the JSON string representation of the object +print(CreateCustomImageRequest.to_json()) + +# convert the object into a dict +create_custom_image_request_dict = create_custom_image_request_instance.to_dict() +# create an instance of CreateCustomImageRequest from a dict +create_custom_image_request_from_dict = CreateCustomImageRequest.from_dict(create_custom_image_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCustomImageResponse.md b/docs/CreateCustomImageResponse.md index cb8c94a..ceaf768 100644 --- a/docs/CreateCustomImageResponse.md +++ b/docs/CreateCustomImageResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CreateCustomImageResponseData]**](CreateCustomImageResponseData.md) | | -**links** | [**CreateCustomImageResponseLinks**](CreateCustomImageResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CreateCustomImageResponseData]**](CreateCustomImageResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_custom_image_response import CreateCustomImageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCustomImageResponse from a JSON string +create_custom_image_response_instance = CreateCustomImageResponse.from_json(json) +# print the JSON string representation of the object +print(CreateCustomImageResponse.to_json()) +# convert the object into a dict +create_custom_image_response_dict = create_custom_image_response_instance.to_dict() +# create an instance of CreateCustomImageResponse from a dict +create_custom_image_response_from_dict = CreateCustomImageResponse.from_dict(create_custom_image_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateCustomImageResponseData.md b/docs/CreateCustomImageResponseData.md index d3e7675..7e8adac 100644 --- a/docs/CreateCustomImageResponseData.md +++ b/docs/CreateCustomImageResponseData.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **image_id** | **str** | Image's id | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_custom_image_response_data import CreateCustomImageResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCustomImageResponseData from a JSON string +create_custom_image_response_data_instance = CreateCustomImageResponseData.from_json(json) +# print the JSON string representation of the object +print(CreateCustomImageResponseData.to_json()) + +# convert the object into a dict +create_custom_image_response_data_dict = create_custom_image_response_data_instance.to_dict() +# create an instance of CreateCustomImageResponseData from a dict +create_custom_image_response_data_from_dict = CreateCustomImageResponseData.from_dict(create_custom_image_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateInstanceAddons.md b/docs/CreateInstanceAddons.md index 1771a96..a9dc6fa 100644 --- a/docs/CreateInstanceAddons.md +++ b/docs/CreateInstanceAddons.md @@ -2,15 +2,32 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**private_networking** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Set this attribute if you want to upgrade your instance with the Private Networking addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] -**additional_ips** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Set this attribute if you want to upgrade your instance with the Additional IPs addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] -**extra_storage** | [**CreateInstanceAddonsExtraStorage**](CreateInstanceAddonsExtraStorage.md) | | [optional] -**custom_image** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Set this attribute if you want to upgrade your instance with the Custom Images addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] -**addons_ids** | [**[AddOnRequest]**](AddOnRequest.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**private_networking** | **object** | Set this attribute if you want to upgrade your instance with the Private Networking addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] +**additional_ips** | **object** | Set this attribute if you want to upgrade your instance with the Additional IPs addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] +**extra_storage** | [**ExtraStorageRequest**](ExtraStorageRequest.md) | Set this attribute if you want to upgrade your instance with the Extra Storage addon. | [optional] +**custom_image** | **object** | Set this attribute if you want to upgrade your instance with the Custom Images addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] +**addons_ids** | [**List[AddOnRequest]**](AddOnRequest.md) | | [optional] + +## Example + +```python +from pfruck_contabo.models.create_instance_addons import CreateInstanceAddons + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceAddons from a JSON string +create_instance_addons_instance = CreateInstanceAddons.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceAddons.to_json()) +# convert the object into a dict +create_instance_addons_dict = create_instance_addons_instance.to_dict() +# create an instance of CreateInstanceAddons from a dict +create_instance_addons_from_dict = CreateInstanceAddons.from_dict(create_instance_addons_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateInstanceRequest.md b/docs/CreateInstanceRequest.md index e2006f8..70cb868 100644 --- a/docs/CreateInstanceRequest.md +++ b/docs/CreateInstanceRequest.md @@ -2,22 +2,39 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**period** | **int** | Initial contract period in months. Available periods are: 1, 3, 6 and 12 months. Default to 1 month | defaults to 1 -**image_id** | **str** | ImageId to be used to setup the compute instance. Default is Ubuntu 22.04 | [optional] if omitted the server will use the default value of "afecbb85-e2fc-46f0-9684-b46b1faf00bb" -**product_id** | **str** | Default is V45 | [optional] if omitted the server will use the default value of "V45" -**region** | **str** | Instance Region where the compute instance should be located. Default is EU | [optional] if omitted the server will use the default value of "EU" -**ssh_keys** | **[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | [optional] +**image_id** | **str** | ImageId to be used to setup the compute instance. Default is Ubuntu 22.04 | [optional] [default to 'afecbb85-e2fc-46f0-9684-b46b1faf00bb'] +**product_id** | **str** | Default is V45 | [optional] [default to 'V45'] +**region** | **str** | Instance Region where the compute instance should be located. Default is EU | [optional] [default to 'EU'] +**ssh_keys** | **List[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | [optional] **root_password** | **int** | `secretId` of the password for the `defaultUser` with administrator/root privileges. For Linux/BSD please use SSH, for Windows RDP. Please refer to Secrets Management API. | [optional] **user_data** | **str** | [Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance. | [optional] **license** | **str** | Additional licence in order to enhance your chosen product, mainly needed for software licenses on your product (not needed for windows). | [optional] +**period** | **int** | Initial contract period in months. Available periods are: 1, 3, 6 and 12 months. Default to 1 month | [default to 1] **display_name** | **str** | The display name of the instance | [optional] -**default_user** | **str** | Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`. | [optional] if omitted the server will use the default value of "admin" -**add_ons** | [**CreateInstanceRequestAddOns**](CreateInstanceRequestAddOns.md) | | [optional] +**default_user** | **str** | Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`. | [optional] [default to 'admin'] +**add_ons** | [**CreateInstanceAddons**](CreateInstanceAddons.md) | Set attributes in the addons object for the corresponding ones that need to be added to the instance | [optional] **application_id** | **str** | Application ID | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_instance_request import CreateInstanceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceRequest from a JSON string +create_instance_request_instance = CreateInstanceRequest.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceRequest.to_json()) + +# convert the object into a dict +create_instance_request_dict = create_instance_request_instance.to_dict() +# create an instance of CreateInstanceRequest from a dict +create_instance_request_from_dict = CreateInstanceRequest.from_dict(create_instance_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateInstanceResponse.md b/docs/CreateInstanceResponse.md index 0cc9b15..bd8bbe2 100644 --- a/docs/CreateInstanceResponse.md +++ b/docs/CreateInstanceResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CreateInstanceResponseData]**](CreateInstanceResponseData.md) | | -**links** | [**PatchInstanceResponseLinks**](PatchInstanceResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CreateInstanceResponseData]**](CreateInstanceResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_instance_response import CreateInstanceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceResponse from a JSON string +create_instance_response_instance = CreateInstanceResponse.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceResponse.to_json()) +# convert the object into a dict +create_instance_response_dict = create_instance_response_instance.to_dict() +# create an instance of CreateInstanceResponse from a dict +create_instance_response_from_dict = CreateInstanceResponse.from_dict(create_instance_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateInstanceResponseData.md b/docs/CreateInstanceResponseData.md index 72651b9..f88f96e 100644 --- a/docs/CreateInstanceResponseData.md +++ b/docs/CreateInstanceResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -11,12 +12,28 @@ Name | Type | Description | Notes **image_id** | **str** | Image's id | **product_id** | **str** | Product ID | **region** | **str** | Instance Region where the compute instance should be located. | -**add_ons** | [**[AddOnResponse]**](AddOnResponse.md) | | +**add_ons** | [**List[AddOnResponse]**](AddOnResponse.md) | | **os_type** | **str** | Type of operating system (OS) | **status** | [**InstanceStatus**](InstanceStatus.md) | | -**ssh_keys** | **[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**ssh_keys** | **List[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | + +## Example + +```python +from pfruck_contabo.models.create_instance_response_data import CreateInstanceResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateInstanceResponseData from a JSON string +create_instance_response_data_instance = CreateInstanceResponseData.from_json(json) +# print the JSON string representation of the object +print(CreateInstanceResponseData.to_json()) +# convert the object into a dict +create_instance_response_data_dict = create_instance_response_data_instance.to_dict() +# create an instance of CreateInstanceResponseData from a dict +create_instance_response_data_from_dict = CreateInstanceResponseData.from_dict(create_instance_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateObjectStorageRequest.md b/docs/CreateObjectStorageRequest.md index af00b77..3af5a19 100644 --- a/docs/CreateObjectStorageRequest.md +++ b/docs/CreateObjectStorageRequest.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**region** | **str** | Region where the object storage should be located. Default is EU. Available regions: EU, US-central, SIN | [default to 'EU'] +**auto_scaling** | [**AutoScalingTypeRequest**](AutoScalingTypeRequest.md) | Autoscaling settings | [optional] **total_purchased_space_tb** | **float** | Amount of purchased / requested object storage in TB. | -**region** | **str** | Region where the object storage should be located. Default is EU. Available regions: EU, US-central, SIN | defaults to "EU" -**auto_scaling** | [**CreateObjectStorageRequestAutoScaling**](CreateObjectStorageRequestAutoScaling.md) | | [optional] **display_name** | **str** | Display name helps to differentiate between object storages, especially if they are in the same region. If display name is not provided, it will be generated. Display name can be changed any time. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_object_storage_request import CreateObjectStorageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateObjectStorageRequest from a JSON string +create_object_storage_request_instance = CreateObjectStorageRequest.from_json(json) +# print the JSON string representation of the object +print(CreateObjectStorageRequest.to_json()) + +# convert the object into a dict +create_object_storage_request_dict = create_object_storage_request_instance.to_dict() +# create an instance of CreateObjectStorageRequest from a dict +create_object_storage_request_from_dict = CreateObjectStorageRequest.from_dict(create_object_storage_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateObjectStorageResponse.md b/docs/CreateObjectStorageResponse.md index 4f4db26..75ac4ab 100644 --- a/docs/CreateObjectStorageResponse.md +++ b/docs/CreateObjectStorageResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CreateObjectStorageResponseData]**](CreateObjectStorageResponseData.md) | | -**links** | [**CreateObjectStorageResponseLinks**](CreateObjectStorageResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CreateObjectStorageResponseData]**](CreateObjectStorageResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_object_storage_response import CreateObjectStorageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateObjectStorageResponse from a JSON string +create_object_storage_response_instance = CreateObjectStorageResponse.from_json(json) +# print the JSON string representation of the object +print(CreateObjectStorageResponse.to_json()) +# convert the object into a dict +create_object_storage_response_dict = create_object_storage_response_instance.to_dict() +# create an instance of CreateObjectStorageResponse from a dict +create_object_storage_response_from_dict = CreateObjectStorageResponse.from_dict(create_object_storage_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateObjectStorageResponseData.md b/docs/CreateObjectStorageResponseData.md index 6d2e042..1c21724 100644 --- a/docs/CreateObjectStorageResponseData.md +++ b/docs/CreateObjectStorageResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -9,7 +10,7 @@ Name | Type | Description | Notes **object_storage_id** | **str** | Your object storage id | **created_date** | **datetime** | Creation date for object storage. | **cancel_date** | **date** | Cancellation date for object storage. | -**auto_scaling** | [**ObjectStorageResponseAutoScaling**](ObjectStorageResponseAutoScaling.md) | | +**auto_scaling** | [**AutoScalingTypeResponse**](AutoScalingTypeResponse.md) | Autoscaling settings | **data_center** | **str** | The data center of the storage | **total_purchased_space_tb** | **float** | Amount of purchased / requested object storage in TB. | **used_space_tb** | **float** | Currently used space in TB. | @@ -19,8 +20,24 @@ Name | Type | Description | Notes **status** | **str** | The object storage status | **region** | **str** | The region where your object storage is located | **display_name** | **str** | Display name for object storage. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_object_storage_response_data import CreateObjectStorageResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateObjectStorageResponseData from a JSON string +create_object_storage_response_data_instance = CreateObjectStorageResponseData.from_json(json) +# print the JSON string representation of the object +print(CreateObjectStorageResponseData.to_json()) + +# convert the object into a dict +create_object_storage_response_data_dict = create_object_storage_response_data_instance.to_dict() +# create an instance of CreateObjectStorageResponseData from a dict +create_object_storage_response_data_from_dict = CreateObjectStorageResponseData.from_dict(create_object_storage_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreatePrivateNetworkRequest.md b/docs/CreatePrivateNetworkRequest.md index abc8305..19c8115 100644 --- a/docs/CreatePrivateNetworkRequest.md +++ b/docs/CreatePrivateNetworkRequest.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**region** | **str** | Region where the Private Network should be located. Default is `EU` | [optional] [default to 'EU'] **name** | **str** | The name of the Private Network. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per Private Network name. | -**region** | **str** | Region where the Private Network should be located. Default is `EU` | [optional] if omitted the server will use the default value of "EU" **description** | **str** | The description of the Private Network. There is a limit of 255 characters per Private Network description. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_private_network_request import CreatePrivateNetworkRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatePrivateNetworkRequest from a JSON string +create_private_network_request_instance = CreatePrivateNetworkRequest.from_json(json) +# print the JSON string representation of the object +print(CreatePrivateNetworkRequest.to_json()) + +# convert the object into a dict +create_private_network_request_dict = create_private_network_request_instance.to_dict() +# create an instance of CreatePrivateNetworkRequest from a dict +create_private_network_request_from_dict = CreatePrivateNetworkRequest.from_dict(create_private_network_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreatePrivateNetworkResponse.md b/docs/CreatePrivateNetworkResponse.md index 5d05702..1f75e78 100644 --- a/docs/CreatePrivateNetworkResponse.md +++ b/docs/CreatePrivateNetworkResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[PrivateNetworkResponse]**](PrivateNetworkResponse.md) | | -**links** | [**CreatePrivateNetworkResponseLinks**](CreatePrivateNetworkResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[PrivateNetworkResponse]**](PrivateNetworkResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_private_network_response import CreatePrivateNetworkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatePrivateNetworkResponse from a JSON string +create_private_network_response_instance = CreatePrivateNetworkResponse.from_json(json) +# print the JSON string representation of the object +print(CreatePrivateNetworkResponse.to_json()) +# convert the object into a dict +create_private_network_response_dict = create_private_network_response_instance.to_dict() +# create an instance of CreatePrivateNetworkResponse from a dict +create_private_network_response_from_dict = CreatePrivateNetworkResponse.from_dict(create_private_network_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateRoleRequest.md b/docs/CreateRoleRequest.md index 710d20d..4ce4405 100644 --- a/docs/CreateRoleRequest.md +++ b/docs/CreateRoleRequest.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the role. There is a limit of 255 characters per role. | **admin** | **bool** | If user is admin he will have permissions to all API endpoints and resources. Enabling this will superseed all role definitions and `accessAllResources`. | **access_all_resources** | **bool** | Allow access to all resources. This will superseed all assigned resources in a role. | -**permissions** | [**[PermissionRequest]**](PermissionRequest.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**permissions** | [**List[PermissionRequest]**](PermissionRequest.md) | | [optional] + +## Example + +```python +from pfruck_contabo.models.create_role_request import CreateRoleRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateRoleRequest from a JSON string +create_role_request_instance = CreateRoleRequest.from_json(json) +# print the JSON string representation of the object +print(CreateRoleRequest.to_json()) +# convert the object into a dict +create_role_request_dict = create_role_request_instance.to_dict() +# create an instance of CreateRoleRequest from a dict +create_role_request_from_dict = CreateRoleRequest.from_dict(create_role_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateRoleResponse.md b/docs/CreateRoleResponse.md index ffbafdb..2f206fe 100644 --- a/docs/CreateRoleResponse.md +++ b/docs/CreateRoleResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CreateRoleResponseData]**](CreateRoleResponseData.md) | | -**links** | [**CreateRoleResponseLinks**](CreateRoleResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CreateRoleResponseData]**](CreateRoleResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_role_response import CreateRoleResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateRoleResponse from a JSON string +create_role_response_instance = CreateRoleResponse.from_json(json) +# print the JSON string representation of the object +print(CreateRoleResponse.to_json()) +# convert the object into a dict +create_role_response_dict = create_role_response_instance.to_dict() +# create an instance of CreateRoleResponse from a dict +create_role_response_from_dict = CreateRoleResponse.from_dict(create_role_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateRoleResponseData.md b/docs/CreateRoleResponseData.md index ec5ba76..43cb788 100644 --- a/docs/CreateRoleResponseData.md +++ b/docs/CreateRoleResponseData.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **role_id** | **int** | Role's id | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_role_response_data import CreateRoleResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateRoleResponseData from a JSON string +create_role_response_data_instance = CreateRoleResponseData.from_json(json) +# print the JSON string representation of the object +print(CreateRoleResponseData.to_json()) + +# convert the object into a dict +create_role_response_data_dict = create_role_response_data_instance.to_dict() +# create an instance of CreateRoleResponseData from a dict +create_role_response_data_from_dict = CreateRoleResponseData.from_dict(create_role_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateSecretRequest.md b/docs/CreateSecretRequest.md index eafd63f..1186157 100644 --- a/docs/CreateSecretRequest.md +++ b/docs/CreateSecretRequest.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the secret that will keep the password | **value** | **str** | The secret value that needs to be saved. In case of a password it must match a pattern with at least one upper and lower case character and either one number with two special characters `!@#$^&*?_~` or at least three numbers with one special character `!@#$^&*?_~`. This is expressed in the following regular expression: `^((?=.*?[A-Z]{1,})(?=.*?[a-z]{1,}))(((?=(?:[^d]*d){1})(?=([^^&*?_~]*[!@#$^&*?_~]){2,}))|((?=(?:[^d]*d){3})(?=.*?[!@#$^&*?_~]+))).{8,}$` | **type** | **str** | The type of the secret. Can be `password` or `ssh` | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_secret_request import CreateSecretRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSecretRequest from a JSON string +create_secret_request_instance = CreateSecretRequest.from_json(json) +# print the JSON string representation of the object +print(CreateSecretRequest.to_json()) + +# convert the object into a dict +create_secret_request_dict = create_secret_request_instance.to_dict() +# create an instance of CreateSecretRequest from a dict +create_secret_request_from_dict = CreateSecretRequest.from_dict(create_secret_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateSecretResponse.md b/docs/CreateSecretResponse.md index 1101740..16ce18b 100644 --- a/docs/CreateSecretResponse.md +++ b/docs/CreateSecretResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[SecretResponse]**](SecretResponse.md) | | -**links** | [**CreateSecretResponseLinks**](CreateSecretResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[SecretResponse]**](SecretResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_secret_response import CreateSecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSecretResponse from a JSON string +create_secret_response_instance = CreateSecretResponse.from_json(json) +# print the JSON string representation of the object +print(CreateSecretResponse.to_json()) +# convert the object into a dict +create_secret_response_dict = create_secret_response_instance.to_dict() +# create an instance of CreateSecretResponse from a dict +create_secret_response_from_dict = CreateSecretResponse.from_dict(create_secret_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateSnapshotRequest.md b/docs/CreateSnapshotRequest.md index 3bf4dae..71a52f8 100644 --- a/docs/CreateSnapshotRequest.md +++ b/docs/CreateSnapshotRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the snapshot. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot. | **description** | **str** | The description of the snapshot. There is a limit of 255 characters per snapshot. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_snapshot_request import CreateSnapshotRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSnapshotRequest from a JSON string +create_snapshot_request_instance = CreateSnapshotRequest.from_json(json) +# print the JSON string representation of the object +print(CreateSnapshotRequest.to_json()) + +# convert the object into a dict +create_snapshot_request_dict = create_snapshot_request_instance.to_dict() +# create an instance of CreateSnapshotRequest from a dict +create_snapshot_request_from_dict = CreateSnapshotRequest.from_dict(create_snapshot_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateSnapshotResponse.md b/docs/CreateSnapshotResponse.md index 0eb9472..e20dd5a 100644 --- a/docs/CreateSnapshotResponse.md +++ b/docs/CreateSnapshotResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[SnapshotResponse]**](SnapshotResponse.md) | | -**links** | [**CreateSnapshotResponseLinks**](CreateSnapshotResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[SnapshotResponse]**](SnapshotResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_snapshot_response import CreateSnapshotResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSnapshotResponse from a JSON string +create_snapshot_response_instance = CreateSnapshotResponse.from_json(json) +# print the JSON string representation of the object +print(CreateSnapshotResponse.to_json()) +# convert the object into a dict +create_snapshot_response_dict = create_snapshot_response_instance.to_dict() +# create an instance of CreateSnapshotResponse from a dict +create_snapshot_response_from_dict = CreateSnapshotResponse.from_dict(create_snapshot_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateTagRequest.md b/docs/CreateTagRequest.md index fd84ee0..acb5419 100644 --- a/docs/CreateTagRequest.md +++ b/docs/CreateTagRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. | -**color** | **str** | The color of the tag. Color can be specified using hexadecimal value. Default color is #0A78C3 | defaults to "#0A78C3" -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**color** | **str** | The color of the tag. Color can be specified using hexadecimal value. Default color is #0A78C3 | [default to '#0A78C3'] + +## Example + +```python +from pfruck_contabo.models.create_tag_request import CreateTagRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateTagRequest from a JSON string +create_tag_request_instance = CreateTagRequest.from_json(json) +# print the JSON string representation of the object +print(CreateTagRequest.to_json()) +# convert the object into a dict +create_tag_request_dict = create_tag_request_instance.to_dict() +# create an instance of CreateTagRequest from a dict +create_tag_request_from_dict = CreateTagRequest.from_dict(create_tag_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateTagResponse.md b/docs/CreateTagResponse.md index c114cd3..7e2c978 100644 --- a/docs/CreateTagResponse.md +++ b/docs/CreateTagResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CreateTagResponseData]**](CreateTagResponseData.md) | | -**links** | [**CreateTagResponseLinks**](CreateTagResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CreateTagResponseData]**](CreateTagResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_tag_response import CreateTagResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateTagResponse from a JSON string +create_tag_response_instance = CreateTagResponse.from_json(json) +# print the JSON string representation of the object +print(CreateTagResponse.to_json()) +# convert the object into a dict +create_tag_response_dict = create_tag_response_instance.to_dict() +# create an instance of CreateTagResponse from a dict +create_tag_response_from_dict = CreateTagResponse.from_dict(create_tag_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateTagResponseData.md b/docs/CreateTagResponseData.md index 7b12e69..7f9824d 100644 --- a/docs/CreateTagResponseData.md +++ b/docs/CreateTagResponseData.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **tag_id** | **int** | Tag's id | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_tag_response_data import CreateTagResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateTagResponseData from a JSON string +create_tag_response_data_instance = CreateTagResponseData.from_json(json) +# print the JSON string representation of the object +print(CreateTagResponseData.to_json()) + +# convert the object into a dict +create_tag_response_data_dict = create_tag_response_data_instance.to_dict() +# create an instance of CreateTagResponseData from a dict +create_tag_response_data_from_dict = CreateTagResponseData.from_dict(create_tag_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateTicketRequest.md b/docs/CreateTicketRequest.md index bdcff84..22eb7aa 100644 --- a/docs/CreateTicketRequest.md +++ b/docs/CreateTicketRequest.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **subject** | **str** | The ticket subject | **note** | **str** | The ticket note | **sender** | **str** | Customer email | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_ticket_request import CreateTicketRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateTicketRequest from a JSON string +create_ticket_request_instance = CreateTicketRequest.from_json(json) +# print the JSON string representation of the object +print(CreateTicketRequest.to_json()) + +# convert the object into a dict +create_ticket_request_dict = create_ticket_request_instance.to_dict() +# create an instance of CreateTicketRequest from a dict +create_ticket_request_from_dict = CreateTicketRequest.from_dict(create_ticket_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateTicketResponse.md b/docs/CreateTicketResponse.md index e984003..4388e24 100644 --- a/docs/CreateTicketResponse.md +++ b/docs/CreateTicketResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CreateTicketResponseData]**](CreateTicketResponseData.md) | | -**links** | [**CreateTicketResponseLinks**](CreateTicketResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CreateTicketResponseData]**](CreateTicketResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_ticket_response import CreateTicketResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateTicketResponse from a JSON string +create_ticket_response_instance = CreateTicketResponse.from_json(json) +# print the JSON string representation of the object +print(CreateTicketResponse.to_json()) +# convert the object into a dict +create_ticket_response_dict = create_ticket_response_instance.to_dict() +# create an instance of CreateTicketResponse from a dict +create_ticket_response_from_dict = CreateTicketResponse.from_dict(create_ticket_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateTicketResponseData.md b/docs/CreateTicketResponseData.md index 4b63b35..780c6cd 100644 --- a/docs/CreateTicketResponseData.md +++ b/docs/CreateTicketResponseData.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_ticket_response_data import CreateTicketResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateTicketResponseData from a JSON string +create_ticket_response_data_instance = CreateTicketResponseData.from_json(json) +# print the JSON string representation of the object +print(CreateTicketResponseData.to_json()) + +# convert the object into a dict +create_ticket_response_data_dict = create_ticket_response_data_instance.to_dict() +# create an instance of CreateTicketResponseData from a dict +create_ticket_response_data_from_dict = CreateTicketResponseData.from_dict(create_ticket_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateUserRequest.md b/docs/CreateUserRequest.md index 0a50226..2c099d9 100644 --- a/docs/CreateUserRequest.md +++ b/docs/CreateUserRequest.md @@ -2,17 +2,34 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**first_name** | **str** | The name of the user. Names may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user. | [optional] +**last_name** | **str** | The last name of the user. Users may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user. | [optional] **email** | **str** | The email of the user to which activation and forgot password links are being sent to. There is a limit of 255 characters per email. | **enabled** | **bool** | If user is not enabled, he can't login and thus use services any longer. | **totp** | **bool** | Enable or disable two-factor authentication (2FA) via time based OTP. | **locale** | **str** | The locale of the user. This can be `de-DE`, `de`, `en-US`, `en` | -**first_name** | **str** | The name of the user. Names may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user. | [optional] -**last_name** | **str** | The last name of the user. Users may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user. | [optional] -**roles** | **[int]** | The roles as list of `roleId`s of the user. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**roles** | **List[int]** | The roles as list of `roleId`s of the user. | [optional] + +## Example + +```python +from pfruck_contabo.models.create_user_request import CreateUserRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateUserRequest from a JSON string +create_user_request_instance = CreateUserRequest.from_json(json) +# print the JSON string representation of the object +print(CreateUserRequest.to_json()) +# convert the object into a dict +create_user_request_dict = create_user_request_instance.to_dict() +# create an instance of CreateUserRequest from a dict +create_user_request_from_dict = CreateUserRequest.from_dict(create_user_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateUserResponse.md b/docs/CreateUserResponse.md index 2775efa..8ec6813 100644 --- a/docs/CreateUserResponse.md +++ b/docs/CreateUserResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CreateUserResponseData]**](CreateUserResponseData.md) | | -**links** | [**CreateUserResponseLinks**](CreateUserResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CreateUserResponseData]**](CreateUserResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.create_user_response import CreateUserResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateUserResponse from a JSON string +create_user_response_instance = CreateUserResponse.from_json(json) +# print the JSON string representation of the object +print(CreateUserResponse.to_json()) +# convert the object into a dict +create_user_response_dict = create_user_response_instance.to_dict() +# create an instance of CreateUserResponse from a dict +create_user_response_from_dict = CreateUserResponse.from_dict(create_user_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CreateUserResponseData.md b/docs/CreateUserResponseData.md index cdb7cee..f537739 100644 --- a/docs/CreateUserResponseData.md +++ b/docs/CreateUserResponseData.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **user_id** | **str** | User's id | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.create_user_response_data import CreateUserResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateUserResponseData from a JSON string +create_user_response_data_instance = CreateUserResponseData.from_json(json) +# print the JSON string representation of the object +print(CreateUserResponseData.to_json()) + +# convert the object into a dict +create_user_response_data_dict = create_user_response_data_instance.to_dict() +# create an instance of CreateUserResponseData from a dict +create_user_response_data_from_dict = CreateUserResponseData.from_dict(create_user_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CredentialData.md b/docs/CredentialData.md index 65cec92..a3dd92e 100644 --- a/docs/CredentialData.md +++ b/docs/CredentialData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -12,8 +13,24 @@ Name | Type | Description | Notes **display_name** | **str** | Object Storage Name. | **region** | **str** | Object Storage Region. | **credential_id** | **float** | Object Storage Credential ID | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.credential_data import CredentialData + +# TODO update the JSON string below +json = "{}" +# create an instance of CredentialData from a JSON string +credential_data_instance = CredentialData.from_json(json) +# print the JSON string representation of the object +print(CredentialData.to_json()) + +# convert the object into a dict +credential_data_dict = credential_data_instance.to_dict() +# create an instance of CredentialData from a dict +credential_data_from_dict = CredentialData.from_dict(credential_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CustomImagesStatsResponse.md b/docs/CustomImagesStatsResponse.md index 4128b21..5dd0010 100644 --- a/docs/CustomImagesStatsResponse.md +++ b/docs/CustomImagesStatsResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CustomImagesStatsResponseData]**](CustomImagesStatsResponseData.md) | | -**links** | [**CustomImagesStatsResponseLinks**](CustomImagesStatsResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CustomImagesStatsResponseData]**](CustomImagesStatsResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.custom_images_stats_response import CustomImagesStatsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomImagesStatsResponse from a JSON string +custom_images_stats_response_instance = CustomImagesStatsResponse.from_json(json) +# print the JSON string representation of the object +print(CustomImagesStatsResponse.to_json()) +# convert the object into a dict +custom_images_stats_response_dict = custom_images_stats_response_instance.to_dict() +# create an instance of CustomImagesStatsResponse from a dict +custom_images_stats_response_from_dict = CustomImagesStatsResponse.from_dict(custom_images_stats_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CustomImagesStatsResponseData.md b/docs/CustomImagesStatsResponseData.md index add825e..4446695 100644 --- a/docs/CustomImagesStatsResponseData.md +++ b/docs/CustomImagesStatsResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -10,8 +11,24 @@ Name | Type | Description | Notes **total_size_mb** | **float** | Total available disk space in MB | **used_size_mb** | **float** | Used disk space in MB | **free_size_mb** | **float** | Free disk space in MB | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.custom_images_stats_response_data import CustomImagesStatsResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomImagesStatsResponseData from a JSON string +custom_images_stats_response_data_instance = CustomImagesStatsResponseData.from_json(json) +# print the JSON string representation of the object +print(CustomImagesStatsResponseData.to_json()) + +# convert the object into a dict +custom_images_stats_response_data_dict = custom_images_stats_response_data_instance.to_dict() +# create an instance of CustomImagesStatsResponseData from a dict +custom_images_stats_response_data_from_dict = CustomImagesStatsResponseData.from_dict(custom_images_stats_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/DataCenterResponse.md b/docs/DataCenterResponse.md index 26521ca..e2d15e5 100644 --- a/docs/DataCenterResponse.md +++ b/docs/DataCenterResponse.md @@ -2,18 +2,35 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the data center | **slug** | **str** | Slug of the data center | -**capabilities** | **[str]** | | +**capabilities** | **List[str]** | | **s3_url** | **str** | S3 URL of the data center | **region_name** | **str** | Name of the region | **region_slug** | **str** | Slug of the region | **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.data_center_response import DataCenterResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DataCenterResponse from a JSON string +data_center_response_instance = DataCenterResponse.from_json(json) +# print the JSON string representation of the object +print(DataCenterResponse.to_json()) + +# convert the object into a dict +data_center_response_dict = data_center_response_instance.to_dict() +# create an instance of DataCenterResponse from a dict +data_center_response_from_dict = DataCenterResponse.from_dict(data_center_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ExtraStorageRequest.md b/docs/ExtraStorageRequest.md index c8a2e61..53dffd0 100644 --- a/docs/ExtraStorageRequest.md +++ b/docs/ExtraStorageRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ssd** | **[str]** | Specify the size in TB and the quantity | [optional] -**nvme** | **[str]** | Specify the size in TB and the quantity | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**ssd** | **List[str]** | Specify the size in TB and the quantity | [optional] +**nvme** | **List[str]** | Specify the size in TB and the quantity | [optional] + +## Example + +```python +from pfruck_contabo.models.extra_storage_request import ExtraStorageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ExtraStorageRequest from a JSON string +extra_storage_request_instance = ExtraStorageRequest.from_json(json) +# print the JSON string representation of the object +print(ExtraStorageRequest.to_json()) +# convert the object into a dict +extra_storage_request_dict = extra_storage_request_instance.to_dict() +# create an instance of ExtraStorageRequest from a dict +extra_storage_request_from_dict = ExtraStorageRequest.from_dict(extra_storage_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindAssignmentResponse.md b/docs/FindAssignmentResponse.md index f089535..66d829f 100644 --- a/docs/FindAssignmentResponse.md +++ b/docs/FindAssignmentResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[AssignmentResponse]**](AssignmentResponse.md) | | -**links** | [**FindAssignmentResponseLinks**](FindAssignmentResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[AssignmentResponse]**](AssignmentResponse.md) | | +**links** | [**TagAssignmentSelfLinks**](TagAssignmentSelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_assignment_response import FindAssignmentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindAssignmentResponse from a JSON string +find_assignment_response_instance = FindAssignmentResponse.from_json(json) +# print the JSON string representation of the object +print(FindAssignmentResponse.to_json()) +# convert the object into a dict +find_assignment_response_dict = find_assignment_response_instance.to_dict() +# create an instance of FindAssignmentResponse from a dict +find_assignment_response_from_dict = FindAssignmentResponse.from_dict(find_assignment_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindClientResponse.md b/docs/FindClientResponse.md index 0c3b968..ec1c01e 100644 --- a/docs/FindClientResponse.md +++ b/docs/FindClientResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[ClientResponse]**](ClientResponse.md) | | -**links** | [**FindClientResponseLinks**](FindClientResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[ClientResponse]**](ClientResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_client_response import FindClientResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindClientResponse from a JSON string +find_client_response_instance = FindClientResponse.from_json(json) +# print the JSON string representation of the object +print(FindClientResponse.to_json()) +# convert the object into a dict +find_client_response_dict = find_client_response_instance.to_dict() +# create an instance of FindClientResponse from a dict +find_client_response_from_dict = FindClientResponse.from_dict(find_client_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindCredentialResponse.md b/docs/FindCredentialResponse.md index bfdc593..bcd5519 100644 --- a/docs/FindCredentialResponse.md +++ b/docs/FindCredentialResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[CredentialData]**](CredentialData.md) | | -**links** | [**FindCredentialResponseLinks**](FindCredentialResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[CredentialData]**](CredentialData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_credential_response import FindCredentialResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindCredentialResponse from a JSON string +find_credential_response_instance = FindCredentialResponse.from_json(json) +# print the JSON string representation of the object +print(FindCredentialResponse.to_json()) +# convert the object into a dict +find_credential_response_dict = find_credential_response_instance.to_dict() +# create an instance of FindCredentialResponse from a dict +find_credential_response_from_dict = FindCredentialResponse.from_dict(find_credential_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindImageResponse.md b/docs/FindImageResponse.md index c673876..df1a075 100644 --- a/docs/FindImageResponse.md +++ b/docs/FindImageResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[ImageResponse]**](ImageResponse.md) | | -**links** | [**CreateCustomImageResponseLinks**](CreateCustomImageResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[ImageResponse]**](ImageResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_image_response import FindImageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindImageResponse from a JSON string +find_image_response_instance = FindImageResponse.from_json(json) +# print the JSON string representation of the object +print(FindImageResponse.to_json()) +# convert the object into a dict +find_image_response_dict = find_image_response_instance.to_dict() +# create an instance of FindImageResponse from a dict +find_image_response_from_dict = FindImageResponse.from_dict(find_image_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindInstanceResponse.md b/docs/FindInstanceResponse.md index 56cac05..8680fc3 100644 --- a/docs/FindInstanceResponse.md +++ b/docs/FindInstanceResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[InstanceResponse]**](InstanceResponse.md) | | -**links** | [**FindInstanceResponseLinks**](FindInstanceResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[InstanceResponse]**](InstanceResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_instance_response import FindInstanceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindInstanceResponse from a JSON string +find_instance_response_instance = FindInstanceResponse.from_json(json) +# print the JSON string representation of the object +print(FindInstanceResponse.to_json()) +# convert the object into a dict +find_instance_response_dict = find_instance_response_instance.to_dict() +# create an instance of FindInstanceResponse from a dict +find_instance_response_from_dict = FindInstanceResponse.from_dict(find_instance_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindObjectStorageResponse.md b/docs/FindObjectStorageResponse.md index a23c5e3..4423228 100644 --- a/docs/FindObjectStorageResponse.md +++ b/docs/FindObjectStorageResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[ObjectStorageResponse]**](ObjectStorageResponse.md) | | -**links** | [**CreateObjectStorageResponseLinks**](CreateObjectStorageResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[ObjectStorageResponse]**](ObjectStorageResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_object_storage_response import FindObjectStorageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindObjectStorageResponse from a JSON string +find_object_storage_response_instance = FindObjectStorageResponse.from_json(json) +# print the JSON string representation of the object +print(FindObjectStorageResponse.to_json()) +# convert the object into a dict +find_object_storage_response_dict = find_object_storage_response_instance.to_dict() +# create an instance of FindObjectStorageResponse from a dict +find_object_storage_response_from_dict = FindObjectStorageResponse.from_dict(find_object_storage_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindPrivateNetworkResponse.md b/docs/FindPrivateNetworkResponse.md index 1e0d732..20ca86b 100644 --- a/docs/FindPrivateNetworkResponse.md +++ b/docs/FindPrivateNetworkResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[PrivateNetworkResponse]**](PrivateNetworkResponse.md) | | -**links** | [**CreatePrivateNetworkResponseLinks**](CreatePrivateNetworkResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[PrivateNetworkResponse]**](PrivateNetworkResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_private_network_response import FindPrivateNetworkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindPrivateNetworkResponse from a JSON string +find_private_network_response_instance = FindPrivateNetworkResponse.from_json(json) +# print the JSON string representation of the object +print(FindPrivateNetworkResponse.to_json()) +# convert the object into a dict +find_private_network_response_dict = find_private_network_response_instance.to_dict() +# create an instance of FindPrivateNetworkResponse from a dict +find_private_network_response_from_dict = FindPrivateNetworkResponse.from_dict(find_private_network_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindRoleResponse.md b/docs/FindRoleResponse.md index 8304b0e..9919ee6 100644 --- a/docs/FindRoleResponse.md +++ b/docs/FindRoleResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[RoleResponse]**](RoleResponse.md) | | -**links** | [**CreateRoleResponseLinks**](CreateRoleResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[RoleResponse]**](RoleResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_role_response import FindRoleResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindRoleResponse from a JSON string +find_role_response_instance = FindRoleResponse.from_json(json) +# print the JSON string representation of the object +print(FindRoleResponse.to_json()) +# convert the object into a dict +find_role_response_dict = find_role_response_instance.to_dict() +# create an instance of FindRoleResponse from a dict +find_role_response_from_dict = FindRoleResponse.from_dict(find_role_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindSecretResponse.md b/docs/FindSecretResponse.md index 8f55ba6..62fe4c7 100644 --- a/docs/FindSecretResponse.md +++ b/docs/FindSecretResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[SecretResponse]**](SecretResponse.md) | | -**links** | [**CreateSecretResponseLinks**](CreateSecretResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[SecretResponse]**](SecretResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_secret_response import FindSecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindSecretResponse from a JSON string +find_secret_response_instance = FindSecretResponse.from_json(json) +# print the JSON string representation of the object +print(FindSecretResponse.to_json()) +# convert the object into a dict +find_secret_response_dict = find_secret_response_instance.to_dict() +# create an instance of FindSecretResponse from a dict +find_secret_response_from_dict = FindSecretResponse.from_dict(find_secret_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindSnapshotResponse.md b/docs/FindSnapshotResponse.md index aa63418..89a9e46 100644 --- a/docs/FindSnapshotResponse.md +++ b/docs/FindSnapshotResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[SnapshotResponse]**](SnapshotResponse.md) | | -**links** | [**CreateSnapshotResponseLinks**](CreateSnapshotResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[SnapshotResponse]**](SnapshotResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_snapshot_response import FindSnapshotResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindSnapshotResponse from a JSON string +find_snapshot_response_instance = FindSnapshotResponse.from_json(json) +# print the JSON string representation of the object +print(FindSnapshotResponse.to_json()) +# convert the object into a dict +find_snapshot_response_dict = find_snapshot_response_instance.to_dict() +# create an instance of FindSnapshotResponse from a dict +find_snapshot_response_from_dict = FindSnapshotResponse.from_dict(find_snapshot_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindTagResponse.md b/docs/FindTagResponse.md index 1d1933b..2b3d95d 100644 --- a/docs/FindTagResponse.md +++ b/docs/FindTagResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[TagResponse]**](TagResponse.md) | | -**links** | [**CreateTagResponseLinks**](CreateTagResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[TagResponse]**](TagResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_tag_response import FindTagResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindTagResponse from a JSON string +find_tag_response_instance = FindTagResponse.from_json(json) +# print the JSON string representation of the object +print(FindTagResponse.to_json()) +# convert the object into a dict +find_tag_response_dict = find_tag_response_instance.to_dict() +# create an instance of FindTagResponse from a dict +find_tag_response_from_dict = FindTagResponse.from_dict(find_tag_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindUserIsPasswordSetResponse.md b/docs/FindUserIsPasswordSetResponse.md index 7216b24..7d5980b 100644 --- a/docs/FindUserIsPasswordSetResponse.md +++ b/docs/FindUserIsPasswordSetResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[UserIsPasswordSetResponse]**](UserIsPasswordSetResponse.md) | | -**links** | [**FindUserIsPasswordSetResponseLinks**](FindUserIsPasswordSetResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[UserIsPasswordSetResponse]**](UserIsPasswordSetResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_user_is_password_set_response import FindUserIsPasswordSetResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindUserIsPasswordSetResponse from a JSON string +find_user_is_password_set_response_instance = FindUserIsPasswordSetResponse.from_json(json) +# print the JSON string representation of the object +print(FindUserIsPasswordSetResponse.to_json()) +# convert the object into a dict +find_user_is_password_set_response_dict = find_user_is_password_set_response_instance.to_dict() +# create an instance of FindUserIsPasswordSetResponse from a dict +find_user_is_password_set_response_from_dict = FindUserIsPasswordSetResponse.from_dict(find_user_is_password_set_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindUserResponse.md b/docs/FindUserResponse.md index a754183..9fd4baf 100644 --- a/docs/FindUserResponse.md +++ b/docs/FindUserResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[UserResponse]**](UserResponse.md) | | -**links** | [**CreateUserResponseLinks**](CreateUserResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[UserResponse]**](UserResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_user_response import FindUserResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindUserResponse from a JSON string +find_user_response_instance = FindUserResponse.from_json(json) +# print the JSON string representation of the object +print(FindUserResponse.to_json()) +# convert the object into a dict +find_user_response_dict = find_user_response_instance.to_dict() +# create an instance of FindUserResponse from a dict +find_user_response_from_dict = FindUserResponse.from_dict(find_user_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FindVncResponse.md b/docs/FindVncResponse.md index 5592cfc..54a1847 100644 --- a/docs/FindVncResponse.md +++ b/docs/FindVncResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[VncResponse]**](VncResponse.md) | | -**links** | [**FindVncResponseLinks**](FindVncResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[VncResponse]**](VncResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.find_vnc_response import FindVncResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of FindVncResponse from a JSON string +find_vnc_response_instance = FindVncResponse.from_json(json) +# print the JSON string representation of the object +print(FindVncResponse.to_json()) +# convert the object into a dict +find_vnc_response_dict = find_vnc_response_instance.to_dict() +# create an instance of FindVncResponse from a dict +find_vnc_response_from_dict = FindVncResponse.from_dict(find_vnc_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FirewallingUpgradeRequest.md b/docs/FirewallingUpgradeRequest.md index 9b4aff2..cd9607a 100644 --- a/docs/FirewallingUpgradeRequest.md +++ b/docs/FirewallingUpgradeRequest.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**assign_firewalls** | **[str]** | List of IDs of firewalls the upgraded instance should be assigned to immediately. If the list is empty or this property is not provided the instance will be assigned to your current default firewall. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**assign_firewalls** | **List[str]** | List of IDs of firewalls the upgraded instance should be assigned to immediately. If the list is empty or this property is not provided the instance will be assigned to your current default firewall. | [optional] + +## Example + +```python +from pfruck_contabo.models.firewalling_upgrade_request import FirewallingUpgradeRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of FirewallingUpgradeRequest from a JSON string +firewalling_upgrade_request_instance = FirewallingUpgradeRequest.from_json(json) +# print the JSON string representation of the object +print(FirewallingUpgradeRequest.to_json()) +# convert the object into a dict +firewalling_upgrade_request_dict = firewalling_upgrade_request_instance.to_dict() +# create an instance of FirewallingUpgradeRequest from a dict +firewalling_upgrade_request_from_dict = FirewallingUpgradeRequest.from_dict(firewalling_upgrade_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GenerateClientSecretResponse.md b/docs/GenerateClientSecretResponse.md index 5d4e5fc..77c999c 100644 --- a/docs/GenerateClientSecretResponse.md +++ b/docs/GenerateClientSecretResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[ClientSecretResponse]**](ClientSecretResponse.md) | | -**links** | [**GenerateClientSecretResponseLinks**](GenerateClientSecretResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[ClientSecretResponse]**](ClientSecretResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.generate_client_secret_response import GenerateClientSecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GenerateClientSecretResponse from a JSON string +generate_client_secret_response_instance = GenerateClientSecretResponse.from_json(json) +# print the JSON string representation of the object +print(GenerateClientSecretResponse.to_json()) +# convert the object into a dict +generate_client_secret_response_dict = generate_client_secret_response_instance.to_dict() +# create an instance of GenerateClientSecretResponse from a dict +generate_client_secret_response_from_dict = GenerateClientSecretResponse.from_dict(generate_client_secret_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ImageAuditResponse.md b/docs/ImageAuditResponse.md index 10bcd25..fb9197a 100644 --- a/docs/ImageAuditResponse.md +++ b/docs/ImageAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[ImageAuditResponseData]**](ImageAuditResponseData.md) | | -**links** | [**ImageAuditResponseLinks**](ImageAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ImageAuditResponseData]**](ImageAuditResponseData.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.image_audit_response import ImageAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageAuditResponse from a JSON string +image_audit_response_instance = ImageAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ImageAuditResponse.to_json()) +# convert the object into a dict +image_audit_response_dict = image_audit_response_instance.to_dict() +# create an instance of ImageAuditResponse from a dict +image_audit_response_from_dict = ImageAuditResponse.from_dict(image_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ImageAuditResponseData.md b/docs/ImageAuditResponseData.md index 815184d..215659d 100644 --- a/docs/ImageAuditResponseData.md +++ b/docs/ImageAuditResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The ID of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | **image_id** | **str** | The identifier of the image | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.image_audit_response_data import ImageAuditResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageAuditResponseData from a JSON string +image_audit_response_data_instance = ImageAuditResponseData.from_json(json) +# print the JSON string representation of the object +print(ImageAuditResponseData.to_json()) +# convert the object into a dict +image_audit_response_data_dict = image_audit_response_data_instance.to_dict() +# create an instance of ImageAuditResponseData from a dict +image_audit_response_data_from_dict = ImageAuditResponseData.from_dict(image_audit_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ImageResponse.md b/docs/ImageResponse.md index a833cc7..e681d0b 100644 --- a/docs/ImageResponse.md +++ b/docs/ImageResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **image_id** | **str** | Image's id | @@ -20,8 +21,24 @@ Name | Type | Description | Notes **standard_image** | **bool** | Flag indicating that image is either a standard (true) or a custom image (false) | **creation_date** | **datetime** | The creation date time for the image | **last_modified_date** | **datetime** | The last modified date time for the image | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.image_response import ImageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ImageResponse from a JSON string +image_response_instance = ImageResponse.from_json(json) +# print the JSON string representation of the object +print(ImageResponse.to_json()) + +# convert the object into a dict +image_response_dict = image_response_instance.to_dict() +# create an instance of ImageResponse from a dict +image_response_from_dict = ImageResponse.from_dict(image_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ImagesApi.md b/docs/ImagesApi.md index 3c69d6f..88a69a8 100644 --- a/docs/ImagesApi.md +++ b/docs/ImagesApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **create_custom_image** -> CreateCustomImageResponse create_custom_image(x_request_id, create_custom_image_request) +> CreateCustomImageResponse create_custom_image(x_request_id, create_custom_image_request, x_trace_id=x_trace_id) Provide a custom image @@ -24,13 +24,12 @@ In order to provide a custom image please specify an URL from where the image ca * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import images_api -from pfruck_contabo.model.create_custom_image_request import CreateCustomImageRequest -from pfruck_contabo.model.create_custom_image_response import CreateCustomImageResponse -from pfruck_contabo.model.create_custom_image_fail_response import CreateCustomImageFailResponse +from pfruck_contabo.models.create_custom_image_request import CreateCustomImageRequest +from pfruck_contabo.models.create_custom_image_response import CreateCustomImageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -44,49 +43,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_custom_image_request = CreateCustomImageRequest( - name="Ubuntu Custom Image", - description="Ubuntu Server 20.04.2 LTS", - url="https://example.com/image.qcow2", - os_type="Linux", - version="20.04.2", - ) # CreateCustomImageRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Provide a custom image - api_response = api_instance.create_custom_image(x_request_id, create_custom_image_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ImagesApi->create_custom_image: %s\n" % e) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_custom_image_request = pfruck_contabo.CreateCustomImageRequest() # CreateCustomImageRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Provide a custom image api_response = api_instance.create_custom_image(x_request_id, create_custom_image_request, x_trace_id=x_trace_id) + print("The response of ImagesApi->create_custom_image:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ImagesApi->create_custom_image: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_custom_image_request** | [**CreateCustomImageRequest**](CreateCustomImageRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_custom_image_request** | [**CreateCustomImageRequest**](CreateCustomImageRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -101,7 +87,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -112,7 +97,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_image** -> delete_image(x_request_id, image_id) +> delete_image(x_request_id, image_id, x_trace_id=x_trace_id) Delete an uploaded custom image by its id @@ -123,10 +108,10 @@ Your are free to delete a previously uploaded custom images at any time * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import images_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -140,41 +125,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - image_id = "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" # str | The identifier of the image - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete an uploaded custom image by its id - api_instance.delete_image(x_request_id, image_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling ImagesApi->delete_image: %s\n" % e) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + image_id = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' # str | The identifier of the image + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete an uploaded custom image by its id api_instance.delete_image(x_request_id, image_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ImagesApi->delete_image: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **image_id** | **str**| The identifier of the image | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **image_id** | **str**| The identifier of the image | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -189,7 +167,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -199,7 +176,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_custom_images_stats** -> CustomImagesStatsResponse retrieve_custom_images_stats(x_request_id) +> CustomImagesStatsResponse retrieve_custom_images_stats(x_request_id, x_trace_id=x_trace_id) List statistics regarding the customer's custom images @@ -210,11 +187,11 @@ List statistics regarding the customer's custom images such as the number of cus * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import images_api -from pfruck_contabo.model.custom_images_stats_response import CustomImagesStatsResponse +from pfruck_contabo.models.custom_images_stats_response import CustomImagesStatsResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -228,41 +205,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # List statistics regarding the customer's custom images - api_response = api_instance.retrieve_custom_images_stats(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ImagesApi->retrieve_custom_images_stats: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List statistics regarding the customer's custom images api_response = api_instance.retrieve_custom_images_stats(x_request_id, x_trace_id=x_trace_id) + print("The response of ImagesApi->retrieve_custom_images_stats:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ImagesApi->retrieve_custom_images_stats: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -277,7 +247,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -287,7 +256,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_image** -> FindImageResponse retrieve_image(x_request_id, image_id) +> FindImageResponse retrieve_image(x_request_id, image_id, x_trace_id=x_trace_id) Get details about a specific image by its id @@ -298,11 +267,11 @@ Get details about a specific image. This could be either a standard or custom im * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import images_api -from pfruck_contabo.model.find_image_response import FindImageResponse +from pfruck_contabo.models.find_image_response import FindImageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -316,43 +285,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - image_id = "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" # str | The identifier of the image - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + image_id = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' # str | The identifier of the image + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get details about a specific image by its id - api_response = api_instance.retrieve_image(x_request_id, image_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ImagesApi->retrieve_image: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get details about a specific image by its id api_response = api_instance.retrieve_image(x_request_id, image_id, x_trace_id=x_trace_id) + print("The response of ImagesApi->retrieve_image:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ImagesApi->retrieve_image: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **image_id** | **str**| The identifier of the image | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **image_id** | **str**| The identifier of the image | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -367,7 +329,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -377,7 +338,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_image_list** -> ListImageResponse retrieve_image_list(x_request_id) +> ListImageResponse retrieve_image_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, standard_image=standard_image) List available standard and custom images @@ -388,11 +349,11 @@ List and filter all available standard images provided by [Contabo](https://cont * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import images_api -from pfruck_contabo.model.list_image_response import ListImageResponse +from pfruck_contabo.models.list_image_response import ListImageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -406,53 +367,44 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - name = "Ubuntu" # str | The name of the image (optional) - standard_image = True # bool | Flag indicating that image is either a standard (true) or a custom image (false) (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + name = 'Ubuntu' # str | The name of the image (optional) + standard_image = true # bool | Flag indicating that image is either a standard (true) or a custom image (false) (optional) - # example passing only required values which don't have defaults set - try: - # List available standard and custom images - api_response = api_instance.retrieve_image_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ImagesApi->retrieve_image_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List available standard and custom images api_response = api_instance.retrieve_image_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, standard_image=standard_image) + print("The response of ImagesApi->retrieve_image_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ImagesApi->retrieve_image_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **name** | **str**| The name of the image | [optional] - **standard_image** | **bool**| Flag indicating that image is either a standard (true) or a custom image (false) | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **name** | **str**| The name of the image | [optional] + **standard_image** | **bool**| Flag indicating that image is either a standard (true) or a custom image (false) | [optional] ### Return type @@ -467,7 +419,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -477,7 +428,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_image** -> UpdateCustomImageResponse update_image(x_request_id, image_id, update_custom_image_request) +> UpdateCustomImageResponse update_image(x_request_id, image_id, update_custom_image_request, x_trace_id=x_trace_id) Update custom image name by its id @@ -488,12 +439,12 @@ Update name of the custom image * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import images_api -from pfruck_contabo.model.update_custom_image_request import UpdateCustomImageRequest -from pfruck_contabo.model.update_custom_image_response import UpdateCustomImageResponse +from pfruck_contabo.models.update_custom_image_request import UpdateCustomImageRequest +from pfruck_contabo.models.update_custom_image_response import UpdateCustomImageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -507,48 +458,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - image_id = "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" # str | The identifier of the image - update_custom_image_request = UpdateCustomImageRequest( - name="Ubuntu Custom Image", - description="Ubuntu 20.04 image", - ) # UpdateCustomImageRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update custom image name by its id - api_response = api_instance.update_image(x_request_id, image_id, update_custom_image_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ImagesApi->update_image: %s\n" % e) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + image_id = '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' # str | The identifier of the image + update_custom_image_request = pfruck_contabo.UpdateCustomImageRequest() # UpdateCustomImageRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update custom image name by its id api_response = api_instance.update_image(x_request_id, image_id, update_custom_image_request, x_trace_id=x_trace_id) + print("The response of ImagesApi->update_image:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ImagesApi->update_image: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **image_id** | **str**| The identifier of the image | - **update_custom_image_request** | [**UpdateCustomImageRequest**](UpdateCustomImageRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **image_id** | **str**| The identifier of the image | + **update_custom_image_request** | [**UpdateCustomImageRequest**](UpdateCustomImageRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -563,7 +504,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ImagesAuditsApi.md b/docs/ImagesAuditsApi.md index dc3d20b..351afa8 100644 --- a/docs/ImagesAuditsApi.md +++ b/docs/ImagesAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_image_audits_list** -> ImageAuditResponse retrieve_image_audits_list(x_request_id) +> ImageAuditResponse retrieve_image_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, image_id=image_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your custom images (audit) @@ -19,11 +19,11 @@ List and filters the history about your custom images. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import images_audits_api -from pfruck_contabo.model.image_audit_response import ImageAuditResponse +from pfruck_contabo.models.image_audit_response import ImageAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_audits_api.ImagesAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ImagesAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - image_id = "e443eab5-647a-4bc3-b4f9-16f5a281224d" # str | The identifier of the image. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | UserId of the user which led to the change. (optional) - start_date = dateutil_parser('2021-06-02').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-06-02').date() # date | End of search time range. (optional) - - # example passing only required values which don't have defaults set - try: - # List history about your custom images (audit) - api_response = api_instance.retrieve_image_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ImagesAuditsApi->retrieve_image_audits_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + image_id = 'e443eab5-647a-4bc3-b4f9-16f5a281224d' # str | The identifier of the image. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | UserId of the user which led to the change. (optional) + start_date = '2021-06-02' # date | Start of search time range. (optional) + end_date = '2021-06-02' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List history about your custom images (audit) api_response = api_instance.retrieve_image_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, image_id=image_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of ImagesAuditsApi->retrieve_image_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ImagesAuditsApi->retrieve_image_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **image_id** | **str**| The identifier of the image. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| UserId of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **image_id** | **str**| The identifier of the image. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| UserId of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/InstanceActionsApi.md b/docs/InstanceActionsApi.md index 9949737..4fb7683 100644 --- a/docs/InstanceActionsApi.md +++ b/docs/InstanceActionsApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **rescue** -> InstanceRescueActionResponse rescue(x_request_id, instance_id, instances_actions_rescue_request) +> InstanceRescueActionResponse rescue(x_request_id, instance_id, instances_actions_rescue_request, x_trace_id=x_trace_id) Rescue a compute instance / resource identified by its id @@ -24,12 +24,12 @@ You can reboot your instance in rescue mode to resolve system issues. Rescue sys * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instance_actions_api -from pfruck_contabo.model.instances_actions_rescue_request import InstancesActionsRescueRequest -from pfruck_contabo.model.instance_rescue_action_response import InstanceRescueActionResponse +from pfruck_contabo.models.instance_rescue_action_response import InstanceRescueActionResponse +from pfruck_contabo.models.instances_actions_rescue_request import InstancesActionsRescueRequest +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -43,61 +43,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instance_actions_api.InstanceActionsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstanceActionsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the compute instance / resource to be started in rescue mode. - instances_actions_rescue_request = InstancesActionsRescueRequest( - root_password=1, - ssh_keys=[ - [123, 125], - ], - user_data='''#cloud-config -user: root -ssh_pwauth: true -disable_root: false -ssh_authorized_keys: - - -chpasswd: - list: - - root: - expire: False -''', - ) # InstancesActionsRescueRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Rescue a compute instance / resource identified by its id - api_response = api_instance.rescue(x_request_id, instance_id, instances_actions_rescue_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstanceActionsApi->rescue: %s\n" % e) + instances_actions_rescue_request = pfruck_contabo.InstancesActionsRescueRequest() # InstancesActionsRescueRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Rescue a compute instance / resource identified by its id api_response = api_instance.rescue(x_request_id, instance_id, instances_actions_rescue_request, x_trace_id=x_trace_id) + print("The response of InstanceActionsApi->rescue:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstanceActionsApi->rescue: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | - **instances_actions_rescue_request** | [**InstancesActionsRescueRequest**](InstancesActionsRescueRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | + **instances_actions_rescue_request** | [**InstancesActionsRescueRequest**](InstancesActionsRescueRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -112,7 +89,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -122,7 +98,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **reset_password_action** -> InstanceResetPasswordActionResponse reset_password_action(x_request_id, instance_id, instances_reset_password_actions_request) +> InstanceResetPasswordActionResponse reset_password_action(x_request_id, instance_id, instances_reset_password_actions_request, x_trace_id=x_trace_id) Reset password for a compute instance / resource referenced by an id @@ -133,12 +109,12 @@ Reset password for a compute instance / resource referenced by an id. This will * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instance_actions_api -from pfruck_contabo.model.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest -from pfruck_contabo.model.instance_reset_password_action_response import InstanceResetPasswordActionResponse +from pfruck_contabo.models.instance_reset_password_action_response import InstanceResetPasswordActionResponse +from pfruck_contabo.models.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -152,61 +128,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instance_actions_api.InstanceActionsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstanceActionsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the compute instance / resource to be started in rescue mode. - instances_reset_password_actions_request = InstancesResetPasswordActionsRequest( - ssh_keys=[ - [123, 125], - ], - root_password=1, - user_data='''#cloud-config -user: root -ssh_pwauth: true -disable_root: false -ssh_authorized_keys: - - -chpasswd: - list: - - root: - expire: False -''', - ) # InstancesResetPasswordActionsRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Reset password for a compute instance / resource referenced by an id - api_response = api_instance.reset_password_action(x_request_id, instance_id, instances_reset_password_actions_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstanceActionsApi->reset_password_action: %s\n" % e) + instances_reset_password_actions_request = pfruck_contabo.InstancesResetPasswordActionsRequest() # InstancesResetPasswordActionsRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Reset password for a compute instance / resource referenced by an id api_response = api_instance.reset_password_action(x_request_id, instance_id, instances_reset_password_actions_request, x_trace_id=x_trace_id) + print("The response of InstanceActionsApi->reset_password_action:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstanceActionsApi->reset_password_action: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | - **instances_reset_password_actions_request** | [**InstancesResetPasswordActionsRequest**](InstancesResetPasswordActionsRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | + **instances_reset_password_actions_request** | [**InstancesResetPasswordActionsRequest**](InstancesResetPasswordActionsRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -221,7 +174,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -231,7 +183,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **restart** -> InstanceRestartActionResponse restart(x_request_id, instance_id) +> InstanceRestartActionResponse restart(x_request_id, instance_id, x_trace_id=x_trace_id) Restart a compute instance / resource identified by its id. @@ -242,11 +194,11 @@ To restart a compute instance that has been identified by its id, you should per * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instance_actions_api -from pfruck_contabo.model.instance_restart_action_response import InstanceRestartActionResponse +from pfruck_contabo.models.instance_restart_action_response import InstanceRestartActionResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -260,43 +212,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instance_actions_api.InstanceActionsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstanceActionsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the compute instance / resource to be started in rescue mode. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Restart a compute instance / resource identified by its id. - api_response = api_instance.restart(x_request_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstanceActionsApi->restart: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Restart a compute instance / resource identified by its id. api_response = api_instance.restart(x_request_id, instance_id, x_trace_id=x_trace_id) + print("The response of InstanceActionsApi->restart:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstanceActionsApi->restart: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -311,7 +256,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -321,7 +265,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **shutdown** -> InstanceShutdownActionResponse shutdown(x_request_id, instance_id) +> InstanceShutdownActionResponse shutdown(x_request_id, instance_id, x_trace_id=x_trace_id) Shutdown compute instance / resource by its id @@ -332,11 +276,11 @@ Shutdown an compute instance / resource. This is similar to pressing the power b * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instance_actions_api -from pfruck_contabo.model.instance_shutdown_action_response import InstanceShutdownActionResponse +from pfruck_contabo.models.instance_shutdown_action_response import InstanceShutdownActionResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -350,43 +294,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instance_actions_api.InstanceActionsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstanceActionsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the compute instance / resource to be started in rescue mode. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Shutdown compute instance / resource by its id - api_response = api_instance.shutdown(x_request_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstanceActionsApi->shutdown: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Shutdown compute instance / resource by its id api_response = api_instance.shutdown(x_request_id, instance_id, x_trace_id=x_trace_id) + print("The response of InstanceActionsApi->shutdown:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstanceActionsApi->shutdown: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -401,7 +338,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -411,7 +347,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **start** -> InstanceStartActionResponse start(x_request_id, instance_id) +> InstanceStartActionResponse start(x_request_id, instance_id, x_trace_id=x_trace_id) Start a compute instance / resource identified by its id @@ -422,11 +358,11 @@ Starting a compute instance / resource is like powering on a real server. If the * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instance_actions_api -from pfruck_contabo.model.instance_start_action_response import InstanceStartActionResponse +from pfruck_contabo.models.instance_start_action_response import InstanceStartActionResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -440,43 +376,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instance_actions_api.InstanceActionsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstanceActionsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the compute instance / resource to be started in rescue mode. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Start a compute instance / resource identified by its id - api_response = api_instance.start(x_request_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstanceActionsApi->start: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Start a compute instance / resource identified by its id api_response = api_instance.start(x_request_id, instance_id, x_trace_id=x_trace_id) + print("The response of InstanceActionsApi->start:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstanceActionsApi->start: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -491,7 +420,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -501,7 +429,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **stop** -> InstanceStopActionResponse stop(x_request_id, instance_id) +> InstanceStopActionResponse stop(x_request_id, instance_id, x_trace_id=x_trace_id) Stop compute instance / resource by its id @@ -512,11 +440,11 @@ Stopping a compute instance / resource is like powering off a real server. So pl * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instance_actions_api -from pfruck_contabo.model.instance_stop_action_response import InstanceStopActionResponse +from pfruck_contabo.models.instance_stop_action_response import InstanceStopActionResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -530,43 +458,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instance_actions_api.InstanceActionsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstanceActionsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the compute instance / resource to be started in rescue mode. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Stop compute instance / resource by its id - api_response = api_instance.stop(x_request_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstanceActionsApi->stop: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Stop compute instance / resource by its id api_response = api_instance.stop(x_request_id, instance_id, x_trace_id=x_trace_id) + print("The response of InstanceActionsApi->stop:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstanceActionsApi->stop: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the compute instance / resource to be started in rescue mode. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -581,7 +502,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/InstanceActionsAuditsApi.md b/docs/InstanceActionsAuditsApi.md index 0471624..8d1a0a5 100644 --- a/docs/InstanceActionsAuditsApi.md +++ b/docs/InstanceActionsAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_instances_actions_audits_list** -> ListInstancesActionsAuditResponse retrieve_instances_actions_audits_list(x_request_id) +> ListInstancesActionsAuditResponse retrieve_instances_actions_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, instance_id=instance_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your actions (audit) triggered via the API @@ -19,11 +19,11 @@ List and filters the history about your actions your triggered via the API. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instance_actions_audits_api -from pfruck_contabo.model.list_instances_actions_audit_response import ListInstancesActionsAuditResponse +from pfruck_contabo.models.list_instances_actions_audit_response import ListInstancesActionsAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instance_actions_audits_api.InstanceActionsAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.InstanceActionsAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) instance_id = 12345 # int | The identifier of the instancesActions. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | changedBy of the user which led to the change. (optional) - start_date = dateutil_parser('2021-06-02').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-06-02').date() # date | End of search time range. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | changedBy of the user which led to the change. (optional) + start_date = '2021-06-02' # date | Start of search time range. (optional) + end_date = '2021-06-02' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your actions (audit) triggered via the API - api_response = api_instance.retrieve_instances_actions_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstanceActionsAuditsApi->retrieve_instances_actions_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your actions (audit) triggered via the API api_response = api_instance.retrieve_instances_actions_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, instance_id=instance_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of InstanceActionsAuditsApi->retrieve_instances_actions_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstanceActionsAuditsApi->retrieve_instances_actions_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **instance_id** | **int**| The identifier of the instancesActions. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| changedBy of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **instance_id** | **int**| The identifier of the instancesActions. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| changedBy of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/InstanceAssignmentSelfLinks.md b/docs/InstanceAssignmentSelfLinks.md index e06ee70..f383526 100644 --- a/docs/InstanceAssignmentSelfLinks.md +++ b/docs/InstanceAssignmentSelfLinks.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_self** | **str** | Link to current resource. | +**var_self** | **str** | Link to current resource. | **virtual_private_cloud** | **str** | Link to related Private Network. | **instance** | **str** | Link to assigned instance. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_assignment_self_links import InstanceAssignmentSelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceAssignmentSelfLinks from a JSON string +instance_assignment_self_links_instance = InstanceAssignmentSelfLinks.from_json(json) +# print the JSON string representation of the object +print(InstanceAssignmentSelfLinks.to_json()) + +# convert the object into a dict +instance_assignment_self_links_dict = instance_assignment_self_links_instance.to_dict() +# create an instance of InstanceAssignmentSelfLinks from a dict +instance_assignment_self_links_from_dict = InstanceAssignmentSelfLinks.from_dict(instance_assignment_self_links_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceRescueActionResponse.md b/docs/InstanceRescueActionResponse.md index 9a520c7..57ee242 100644 --- a/docs/InstanceRescueActionResponse.md +++ b/docs/InstanceRescueActionResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[InstanceRescueActionResponseData]**](InstanceRescueActionResponseData.md) | | -**links** | [**InstanceRescueActionResponseLinks**](InstanceRescueActionResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[InstanceRescueActionResponseData]**](InstanceRescueActionResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.instance_rescue_action_response import InstanceRescueActionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceRescueActionResponse from a JSON string +instance_rescue_action_response_instance = InstanceRescueActionResponse.from_json(json) +# print the JSON string representation of the object +print(InstanceRescueActionResponse.to_json()) +# convert the object into a dict +instance_rescue_action_response_dict = instance_rescue_action_response_instance.to_dict() +# create an instance of InstanceRescueActionResponse from a dict +instance_rescue_action_response_from_dict = InstanceRescueActionResponse.from_dict(instance_rescue_action_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceRescueActionResponseData.md b/docs/InstanceRescueActionResponseData.md index 7b002c3..74abb18 100644 --- a/docs/InstanceRescueActionResponseData.md +++ b/docs/InstanceRescueActionResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Compute instance / resource id | **action** | **str** | Action that was triggered | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_rescue_action_response_data import InstanceRescueActionResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceRescueActionResponseData from a JSON string +instance_rescue_action_response_data_instance = InstanceRescueActionResponseData.from_json(json) +# print the JSON string representation of the object +print(InstanceRescueActionResponseData.to_json()) + +# convert the object into a dict +instance_rescue_action_response_data_dict = instance_rescue_action_response_data_instance.to_dict() +# create an instance of InstanceRescueActionResponseData from a dict +instance_rescue_action_response_data_from_dict = InstanceRescueActionResponseData.from_dict(instance_rescue_action_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceResetPasswordActionResponse.md b/docs/InstanceResetPasswordActionResponse.md index bdd83c1..194d827 100644 --- a/docs/InstanceResetPasswordActionResponse.md +++ b/docs/InstanceResetPasswordActionResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[InstanceResetPasswordActionResponseData]**](InstanceResetPasswordActionResponseData.md) | | -**links** | [**InstanceResetPasswordActionResponseLinks**](InstanceResetPasswordActionResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[InstanceResetPasswordActionResponseData]**](InstanceResetPasswordActionResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.instance_reset_password_action_response import InstanceResetPasswordActionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceResetPasswordActionResponse from a JSON string +instance_reset_password_action_response_instance = InstanceResetPasswordActionResponse.from_json(json) +# print the JSON string representation of the object +print(InstanceResetPasswordActionResponse.to_json()) +# convert the object into a dict +instance_reset_password_action_response_dict = instance_reset_password_action_response_instance.to_dict() +# create an instance of InstanceResetPasswordActionResponse from a dict +instance_reset_password_action_response_from_dict = InstanceResetPasswordActionResponse.from_dict(instance_reset_password_action_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceResetPasswordActionResponseData.md b/docs/InstanceResetPasswordActionResponseData.md index 5b8bd36..65f3ac4 100644 --- a/docs/InstanceResetPasswordActionResponseData.md +++ b/docs/InstanceResetPasswordActionResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Compute instance / resource id | **action** | **str** | Action that was triggered | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_reset_password_action_response_data import InstanceResetPasswordActionResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceResetPasswordActionResponseData from a JSON string +instance_reset_password_action_response_data_instance = InstanceResetPasswordActionResponseData.from_json(json) +# print the JSON string representation of the object +print(InstanceResetPasswordActionResponseData.to_json()) + +# convert the object into a dict +instance_reset_password_action_response_data_dict = instance_reset_password_action_response_data_instance.to_dict() +# create an instance of InstanceResetPasswordActionResponseData from a dict +instance_reset_password_action_response_data_from_dict = InstanceResetPasswordActionResponseData.from_dict(instance_reset_password_action_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceResponse.md b/docs/InstanceResponse.md index fe9a485..f79947b 100644 --- a/docs/InstanceResponse.md +++ b/docs/InstanceResponse.md @@ -2,11 +2,12 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Customer ID | -**additional_ips** | [**[AdditionalIp]**](AdditionalIp.md) | | +**additional_ips** | [**List[AdditionalIp]**](AdditionalIp.md) | | **name** | **str** | Instance Name | **display_name** | **str** | Instance display name | **instance_id** | **int** | Instance ID | @@ -21,20 +22,36 @@ Name | Type | Description | Notes **cpu_cores** | **int** | CPU core count | **os_type** | **str** | Type of operating system (OS) | **disk_mb** | **float** | Image Disk size in MB | -**ssh_keys** | **[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | +**ssh_keys** | **List[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | **created_date** | **datetime** | The creation date for the instance | **cancel_date** | **date** | The date on which the instance will be cancelled | **status** | [**InstanceStatus**](InstanceStatus.md) | | **v_host_id** | **int** | ID of host system | **v_host_number** | **int** | Number of host system | **v_host_name** | **str** | Name of host system | -**add_ons** | [**[AddOnResponse]**](AddOnResponse.md) | | +**add_ons** | [**List[AddOnResponse]**](AddOnResponse.md) | | +**error_message** | **str** | Message in case of an error. | [optional] **product_type** | **str** | Instance's category depending on Product Id | **product_name** | **str** | Instance's Product Name | -**error_message** | **str** | Message in case of an error. | [optional] **default_user** | **str** | Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_response import InstanceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceResponse from a JSON string +instance_response_instance = InstanceResponse.from_json(json) +# print the JSON string representation of the object +print(InstanceResponse.to_json()) + +# convert the object into a dict +instance_response_dict = instance_response_instance.to_dict() +# create an instance of InstanceResponse from a dict +instance_response_from_dict = InstanceResponse.from_dict(instance_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceRestartActionResponse.md b/docs/InstanceRestartActionResponse.md index 38198f8..7941eb1 100644 --- a/docs/InstanceRestartActionResponse.md +++ b/docs/InstanceRestartActionResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[InstanceRestartActionResponseData]**](InstanceRestartActionResponseData.md) | | -**links** | [**InstanceRestartActionResponseLinks**](InstanceRestartActionResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[InstanceRestartActionResponseData]**](InstanceRestartActionResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.instance_restart_action_response import InstanceRestartActionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceRestartActionResponse from a JSON string +instance_restart_action_response_instance = InstanceRestartActionResponse.from_json(json) +# print the JSON string representation of the object +print(InstanceRestartActionResponse.to_json()) +# convert the object into a dict +instance_restart_action_response_dict = instance_restart_action_response_instance.to_dict() +# create an instance of InstanceRestartActionResponse from a dict +instance_restart_action_response_from_dict = InstanceRestartActionResponse.from_dict(instance_restart_action_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceRestartActionResponseData.md b/docs/InstanceRestartActionResponseData.md index cb064ca..e28735d 100644 --- a/docs/InstanceRestartActionResponseData.md +++ b/docs/InstanceRestartActionResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Compute instance / resource id | **action** | **str** | Action that was triggered | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_restart_action_response_data import InstanceRestartActionResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceRestartActionResponseData from a JSON string +instance_restart_action_response_data_instance = InstanceRestartActionResponseData.from_json(json) +# print the JSON string representation of the object +print(InstanceRestartActionResponseData.to_json()) + +# convert the object into a dict +instance_restart_action_response_data_dict = instance_restart_action_response_data_instance.to_dict() +# create an instance of InstanceRestartActionResponseData from a dict +instance_restart_action_response_data_from_dict = InstanceRestartActionResponseData.from_dict(instance_restart_action_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceShutdownActionResponse.md b/docs/InstanceShutdownActionResponse.md index f5821dc..fe4701d 100644 --- a/docs/InstanceShutdownActionResponse.md +++ b/docs/InstanceShutdownActionResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[InstanceShutdownActionResponseData]**](InstanceShutdownActionResponseData.md) | | -**links** | [**InstanceShutdownActionResponseLinks**](InstanceShutdownActionResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[InstanceShutdownActionResponseData]**](InstanceShutdownActionResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.instance_shutdown_action_response import InstanceShutdownActionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceShutdownActionResponse from a JSON string +instance_shutdown_action_response_instance = InstanceShutdownActionResponse.from_json(json) +# print the JSON string representation of the object +print(InstanceShutdownActionResponse.to_json()) +# convert the object into a dict +instance_shutdown_action_response_dict = instance_shutdown_action_response_instance.to_dict() +# create an instance of InstanceShutdownActionResponse from a dict +instance_shutdown_action_response_from_dict = InstanceShutdownActionResponse.from_dict(instance_shutdown_action_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceShutdownActionResponseData.md b/docs/InstanceShutdownActionResponseData.md index 82d23c5..d6cc495 100644 --- a/docs/InstanceShutdownActionResponseData.md +++ b/docs/InstanceShutdownActionResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Compute instance / resource id | **action** | **str** | Action that was triggered | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_shutdown_action_response_data import InstanceShutdownActionResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceShutdownActionResponseData from a JSON string +instance_shutdown_action_response_data_instance = InstanceShutdownActionResponseData.from_json(json) +# print the JSON string representation of the object +print(InstanceShutdownActionResponseData.to_json()) + +# convert the object into a dict +instance_shutdown_action_response_data_dict = instance_shutdown_action_response_data_instance.to_dict() +# create an instance of InstanceShutdownActionResponseData from a dict +instance_shutdown_action_response_data_from_dict = InstanceShutdownActionResponseData.from_dict(instance_shutdown_action_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceStartActionResponse.md b/docs/InstanceStartActionResponse.md index 8f8dac5..9ea411e 100644 --- a/docs/InstanceStartActionResponse.md +++ b/docs/InstanceStartActionResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[InstanceStartActionResponseData]**](InstanceStartActionResponseData.md) | | -**links** | [**InstanceStartActionResponseLinks**](InstanceStartActionResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[InstanceStartActionResponseData]**](InstanceStartActionResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.instance_start_action_response import InstanceStartActionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceStartActionResponse from a JSON string +instance_start_action_response_instance = InstanceStartActionResponse.from_json(json) +# print the JSON string representation of the object +print(InstanceStartActionResponse.to_json()) +# convert the object into a dict +instance_start_action_response_dict = instance_start_action_response_instance.to_dict() +# create an instance of InstanceStartActionResponse from a dict +instance_start_action_response_from_dict = InstanceStartActionResponse.from_dict(instance_start_action_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceStartActionResponseData.md b/docs/InstanceStartActionResponseData.md index 4f42c35..506b8e8 100644 --- a/docs/InstanceStartActionResponseData.md +++ b/docs/InstanceStartActionResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Compute instance / resource id | **action** | **str** | Action that was triggered | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_start_action_response_data import InstanceStartActionResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceStartActionResponseData from a JSON string +instance_start_action_response_data_instance = InstanceStartActionResponseData.from_json(json) +# print the JSON string representation of the object +print(InstanceStartActionResponseData.to_json()) + +# convert the object into a dict +instance_start_action_response_data_dict = instance_start_action_response_data_instance.to_dict() +# create an instance of InstanceStartActionResponseData from a dict +instance_start_action_response_data_from_dict = InstanceStartActionResponseData.from_dict(instance_start_action_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceStatus.md b/docs/InstanceStatus.md index b8802e3..d385471 100644 --- a/docs/InstanceStatus.md +++ b/docs/InstanceStatus.md @@ -2,9 +2,9 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | | must be one of ["provisioning", "uninstalled", "running", "stopped", "error", "installing", "unknown", "manual_provisioning", "product_not_available", "verification_required", "rescue", "pending_payment", "other", ] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceStopActionResponse.md b/docs/InstanceStopActionResponse.md index cb87bfd..1c4ab67 100644 --- a/docs/InstanceStopActionResponse.md +++ b/docs/InstanceStopActionResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[InstanceStopActionResponseData]**](InstanceStopActionResponseData.md) | | -**links** | [**InstanceStopActionResponseLinks**](InstanceStopActionResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[InstanceStopActionResponseData]**](InstanceStopActionResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.instance_stop_action_response import InstanceStopActionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceStopActionResponse from a JSON string +instance_stop_action_response_instance = InstanceStopActionResponse.from_json(json) +# print the JSON string representation of the object +print(InstanceStopActionResponse.to_json()) +# convert the object into a dict +instance_stop_action_response_dict = instance_stop_action_response_instance.to_dict() +# create an instance of InstanceStopActionResponse from a dict +instance_stop_action_response_from_dict = InstanceStopActionResponse.from_dict(instance_stop_action_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstanceStopActionResponseData.md b/docs/InstanceStopActionResponseData.md index 4f0d2c3..1c9209b 100644 --- a/docs/InstanceStopActionResponseData.md +++ b/docs/InstanceStopActionResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Compute instance / resource id | **action** | **str** | Action that was triggered | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instance_stop_action_response_data import InstanceStopActionResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of InstanceStopActionResponseData from a JSON string +instance_stop_action_response_data_instance = InstanceStopActionResponseData.from_json(json) +# print the JSON string representation of the object +print(InstanceStopActionResponseData.to_json()) + +# convert the object into a dict +instance_stop_action_response_data_dict = instance_stop_action_response_data_instance.to_dict() +# create an instance of InstanceStopActionResponseData from a dict +instance_stop_action_response_data_from_dict = InstanceStopActionResponseData.from_dict(instance_stop_action_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Instances.md b/docs/Instances.md index e281443..ddeba3c 100644 --- a/docs/Instances.md +++ b/docs/Instances.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **instance_id** | **int** | Instance id | @@ -12,8 +13,24 @@ Name | Type | Description | Notes **ip_config** | [**IpConfig**](IpConfig.md) | | **status** | **str** | State of the instance in the Private Network | **error_message** | **str** | Message in case of an error. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instances import Instances + +# TODO update the JSON string below +json = "{}" +# create an instance of Instances from a JSON string +instances_instance = Instances.from_json(json) +# print the JSON string representation of the object +print(Instances.to_json()) + +# convert the object into a dict +instances_dict = instances_instance.to_dict() +# create an instance of Instances from a dict +instances_from_dict = Instances.from_dict(instances_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstancesActionsAuditResponse.md b/docs/InstancesActionsAuditResponse.md index 0812916..fc9e9e8 100644 --- a/docs/InstancesActionsAuditResponse.md +++ b/docs/InstancesActionsAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The ID of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | **instance_id** | **int** | The identifier of the instancesActions | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.instances_actions_audit_response import InstancesActionsAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstancesActionsAuditResponse from a JSON string +instances_actions_audit_response_instance = InstancesActionsAuditResponse.from_json(json) +# print the JSON string representation of the object +print(InstancesActionsAuditResponse.to_json()) +# convert the object into a dict +instances_actions_audit_response_dict = instances_actions_audit_response_instance.to_dict() +# create an instance of InstancesActionsAuditResponse from a dict +instances_actions_audit_response_from_dict = InstancesActionsAuditResponse.from_dict(instances_actions_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstancesActionsRescueRequest.md b/docs/InstancesActionsRescueRequest.md index d087ea3..29e7a23 100644 --- a/docs/InstancesActionsRescueRequest.md +++ b/docs/InstancesActionsRescueRequest.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **root_password** | **int** | `secretId` of the password to login into rescue system for the `root` user. | [optional] -**ssh_keys** | **[int]** | Array of `secretId`s of public SSH keys for logging into rescue system as `root` user. | [optional] +**ssh_keys** | **List[int]** | Array of `secretId`s of public SSH keys for logging into rescue system as `root` user. | [optional] **user_data** | **str** | [Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instances_actions_rescue_request import InstancesActionsRescueRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of InstancesActionsRescueRequest from a JSON string +instances_actions_rescue_request_instance = InstancesActionsRescueRequest.from_json(json) +# print the JSON string representation of the object +print(InstancesActionsRescueRequest.to_json()) + +# convert the object into a dict +instances_actions_rescue_request_dict = instances_actions_rescue_request_instance.to_dict() +# create an instance of InstancesActionsRescueRequest from a dict +instances_actions_rescue_request_from_dict = InstancesActionsRescueRequest.from_dict(instances_actions_rescue_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstancesApi.md b/docs/InstancesApi.md index 4508a02..bf8f452 100644 --- a/docs/InstancesApi.md +++ b/docs/InstancesApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description # **cancel_instance** -> CancelInstanceResponse cancel_instance(x_request_id, instance_id) +> CancelInstanceResponse cancel_instance(x_request_id, instance_id, x_trace_id=x_trace_id) Cancel specific instance by id @@ -25,11 +25,11 @@ Your are free to cancel a previously created instance at any time. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instances_api -from pfruck_contabo.model.cancel_instance_response import CancelInstanceResponse +from pfruck_contabo.models.cancel_instance_response import CancelInstanceResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -43,43 +43,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instances_api.InstancesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstancesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Cancel specific instance by id - api_response = api_instance.cancel_instance(x_request_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstancesApi->cancel_instance: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Cancel specific instance by id api_response = api_instance.cancel_instance(x_request_id, instance_id, x_trace_id=x_trace_id) + print("The response of InstancesApi->cancel_instance:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesApi->cancel_instance: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -94,7 +87,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -104,7 +96,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_instance** -> CreateInstanceResponse create_instance(x_request_id, create_instance_request) +> CreateInstanceResponse create_instance(x_request_id, create_instance_request, x_trace_id=x_trace_id) Create a new instance @@ -115,12 +107,12 @@ Create a new instance for your account with the provided parameters. create_instance: %s\n" % e) + api_instance = pfruck_contabo.InstancesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_instance_request = pfruck_contabo.CreateInstanceRequest() # CreateInstanceRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new instance api_response = api_instance.create_instance(x_request_id, create_instance_request, x_trace_id=x_trace_id) + print("The response of InstancesApi->create_instance:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesApi->create_instance: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_instance_request** | [**CreateInstanceRequest**](CreateInstanceRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_instance_request** | [**CreateInstanceRequest**](CreateInstanceRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -204,7 +170,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -214,7 +179,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **patch_instance** -> PatchInstanceResponse patch_instance(x_request_id, instance_id, patch_instance_request) +> PatchInstanceResponse patch_instance(x_request_id, instance_id, patch_instance_request, x_trace_id=x_trace_id) Update specific instance @@ -225,12 +190,12 @@ Update specific instance by instanceId. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instances_api -from pfruck_contabo.model.patch_instance_response import PatchInstanceResponse -from pfruck_contabo.model.patch_instance_request import PatchInstanceRequest +from pfruck_contabo.models.patch_instance_request import PatchInstanceRequest +from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -244,47 +209,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instances_api.InstancesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstancesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - patch_instance_request = PatchInstanceRequest( - display_name="VPS", - ) # PatchInstanceRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update specific instance - api_response = api_instance.patch_instance(x_request_id, instance_id, patch_instance_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstancesApi->patch_instance: %s\n" % e) + patch_instance_request = pfruck_contabo.PatchInstanceRequest() # PatchInstanceRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update specific instance api_response = api_instance.patch_instance(x_request_id, instance_id, patch_instance_request, x_trace_id=x_trace_id) + print("The response of InstancesApi->patch_instance:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesApi->patch_instance: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **patch_instance_request** | [**PatchInstanceRequest**](PatchInstanceRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **patch_instance_request** | [**PatchInstanceRequest**](PatchInstanceRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -299,7 +255,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -309,7 +264,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **reinstall_instance** -> ReinstallInstanceResponse reinstall_instance(x_request_id, instance_id, reinstall_instance_request) +> ReinstallInstanceResponse reinstall_instance(x_request_id, instance_id, reinstall_instance_request, x_trace_id=x_trace_id) Reinstall specific instance @@ -320,12 +275,12 @@ You can reinstall a specific instance with a new image and optionally add ssh ke * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instances_api -from pfruck_contabo.model.reinstall_instance_request import ReinstallInstanceRequest -from pfruck_contabo.model.reinstall_instance_response import ReinstallInstanceResponse +from pfruck_contabo.models.reinstall_instance_request import ReinstallInstanceRequest +from pfruck_contabo.models.reinstall_instance_response import ReinstallInstanceResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -339,58 +294,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instances_api.InstancesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstancesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - reinstall_instance_request = ReinstallInstanceRequest( - image_id="3f184ab8-a600-4e7c-8c9b-3413e21a3752", - ssh_keys=[ - [123, 125], - ], - root_password=1, - user_data='''#cloud-config -user: admin -timezone: Europe/Berlin -chpasswd: - expire: False''', - default_user="root", - application_id="3f184ab8-a600-4e7c-8c9b-3413e21a3752", - ) # ReinstallInstanceRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Reinstall specific instance - api_response = api_instance.reinstall_instance(x_request_id, instance_id, reinstall_instance_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstancesApi->reinstall_instance: %s\n" % e) + reinstall_instance_request = pfruck_contabo.ReinstallInstanceRequest() # ReinstallInstanceRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Reinstall specific instance api_response = api_instance.reinstall_instance(x_request_id, instance_id, reinstall_instance_request, x_trace_id=x_trace_id) + print("The response of InstancesApi->reinstall_instance:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesApi->reinstall_instance: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **reinstall_instance_request** | [**ReinstallInstanceRequest**](ReinstallInstanceRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **reinstall_instance_request** | [**ReinstallInstanceRequest**](ReinstallInstanceRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -405,7 +340,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -415,7 +349,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_instance** -> FindInstanceResponse retrieve_instance(x_request_id, instance_id) +> FindInstanceResponse retrieve_instance(x_request_id, instance_id, x_trace_id=x_trace_id) Get specific instance by id @@ -426,11 +360,11 @@ Get attributes values to a specific instance on your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instances_api -from pfruck_contabo.model.find_instance_response import FindInstanceResponse +from pfruck_contabo.models.find_instance_response import FindInstanceResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -444,43 +378,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instances_api.InstancesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstancesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get specific instance by id - api_response = api_instance.retrieve_instance(x_request_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstancesApi->retrieve_instance: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get specific instance by id api_response = api_instance.retrieve_instance(x_request_id, instance_id, x_trace_id=x_trace_id) + print("The response of InstancesApi->retrieve_instance:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesApi->retrieve_instance: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -495,7 +422,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -505,7 +431,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_instances_list** -> ListInstancesResponse retrieve_instances_list(x_request_id) +> ListInstancesResponse retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config) List instances @@ -516,11 +442,11 @@ List and filter all instances in your account * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instances_api -from pfruck_contabo.model.list_instances_response import ListInstancesResponse +from pfruck_contabo.models.list_instances_response import ListInstancesResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -534,69 +460,60 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instances_api.InstancesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.InstancesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - name = "vmd12345" # str | The name of the instance (optional) - display_name = "myTestInstance" # str | The display name of the instance (optional) - data_center = "European Union 1" # str | The data center of the instance (optional) - region = "EU" # str | The Region of the instance (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + name = 'vmd12345' # str | The name of the instance (optional) + display_name = 'myTestInstance' # str | The display name of the instance (optional) + data_center = 'European Union 1' # str | The data center of the instance (optional) + region = 'EU' # str | The Region of the instance (optional) instance_id = 100 # int | The identifier of the instance (deprecated) (optional) - instance_ids = "100, 101, 102" # str | Comma separated instances identifiers (optional) - status = "provisioning,installing" # str | The status of the instance (optional) - add_on_ids = "1044,827" # str | Identifiers of Addons the instances have (optional) - product_types = "ssd, hdd, nvme" # str | Comma separated instance's category depending on Product Id (optional) - ip_config = True # bool | Filter instances that have an ip config (optional) - - # example passing only required values which don't have defaults set - try: - # List instances - api_response = api_instance.retrieve_instances_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstancesApi->retrieve_instances_list: %s\n" % e) + instance_ids = '100, 101, 102' # str | Comma separated instances identifiers (optional) + status = 'provisioning,installing' # str | The status of the instance (optional) + add_on_ids = '1044,827' # str | Identifiers of Addons the instances have (optional) + product_types = 'ssd, hdd, nvme' # str | Comma separated instance's category depending on Product Id (optional) + ip_config = true # bool | Filter instances that have an ip config (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List instances api_response = api_instance.retrieve_instances_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, display_name=display_name, data_center=data_center, region=region, instance_id=instance_id, instance_ids=instance_ids, status=status, add_on_ids=add_on_ids, product_types=product_types, ip_config=ip_config) + print("The response of InstancesApi->retrieve_instances_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesApi->retrieve_instances_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **name** | **str**| The name of the instance | [optional] - **display_name** | **str**| The display name of the instance | [optional] - **data_center** | **str**| The data center of the instance | [optional] - **region** | **str**| The Region of the instance | [optional] - **instance_id** | **int**| The identifier of the instance (deprecated) | [optional] - **instance_ids** | **str**| Comma separated instances identifiers | [optional] - **status** | **str**| The status of the instance | [optional] - **add_on_ids** | **str**| Identifiers of Addons the instances have | [optional] - **product_types** | **str**| Comma separated instance's category depending on Product Id | [optional] - **ip_config** | **bool**| Filter instances that have an ip config | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **name** | **str**| The name of the instance | [optional] + **display_name** | **str**| The display name of the instance | [optional] + **data_center** | **str**| The data center of the instance | [optional] + **region** | **str**| The Region of the instance | [optional] + **instance_id** | **int**| The identifier of the instance (deprecated) | [optional] + **instance_ids** | **str**| Comma separated instances identifiers | [optional] + **status** | **str**| The status of the instance | [optional] + **add_on_ids** | **str**| Identifiers of Addons the instances have | [optional] + **product_types** | **str**| Comma separated instance's category depending on Product Id | [optional] + **ip_config** | **bool**| Filter instances that have an ip config | [optional] ### Return type @@ -611,7 +528,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -621,7 +537,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upgrade_instance** -> PatchInstanceResponse upgrade_instance(x_request_id, instance_id, upgrade_instance_request) +> PatchInstanceResponse upgrade_instance(x_request_id, instance_id, upgrade_instance_request, x_trace_id=x_trace_id) Upgrading instance capabilities @@ -632,12 +548,12 @@ In order to enhance your instance with additional features you can purchase add- * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instances_api -from pfruck_contabo.model.patch_instance_response import PatchInstanceResponse -from pfruck_contabo.model.upgrade_instance_request import UpgradeInstanceRequest +from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse +from pfruck_contabo.models.upgrade_instance_request import UpgradeInstanceRequest +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -651,47 +567,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instances_api.InstancesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.InstancesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - upgrade_instance_request = UpgradeInstanceRequest( - private_networking=None, - ) # UpgradeInstanceRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + upgrade_instance_request = pfruck_contabo.UpgradeInstanceRequest() # UpgradeInstanceRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Upgrading instance capabilities - api_response = api_instance.upgrade_instance(x_request_id, instance_id, upgrade_instance_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstancesApi->upgrade_instance: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Upgrading instance capabilities api_response = api_instance.upgrade_instance(x_request_id, instance_id, upgrade_instance_request, x_trace_id=x_trace_id) + print("The response of InstancesApi->upgrade_instance:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesApi->upgrade_instance: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **upgrade_instance_request** | [**UpgradeInstanceRequest**](UpgradeInstanceRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **upgrade_instance_request** | [**UpgradeInstanceRequest**](UpgradeInstanceRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -706,7 +613,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/InstancesAuditResponse.md b/docs/InstancesAuditResponse.md index 35b0231..710035f 100644 --- a/docs/InstancesAuditResponse.md +++ b/docs/InstancesAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The ID of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | **instance_id** | **int** | The identifier of the instance | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.instances_audit_response import InstancesAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of InstancesAuditResponse from a JSON string +instances_audit_response_instance = InstancesAuditResponse.from_json(json) +# print the JSON string representation of the object +print(InstancesAuditResponse.to_json()) +# convert the object into a dict +instances_audit_response_dict = instances_audit_response_instance.to_dict() +# create an instance of InstancesAuditResponse from a dict +instances_audit_response_from_dict = InstancesAuditResponse.from_dict(instances_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InstancesAuditsApi.md b/docs/InstancesAuditsApi.md index 91fa082..da4368d 100644 --- a/docs/InstancesAuditsApi.md +++ b/docs/InstancesAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_instances_audits_list** -> ListInstancesAuditResponse retrieve_instances_audits_list(x_request_id) +> ListInstancesAuditResponse retrieve_instances_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, instance_id=instance_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your instances (audit) @@ -19,11 +19,11 @@ List and filters the history about your instances. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import instances_audits_api -from pfruck_contabo.model.list_instances_audit_response import ListInstancesAuditResponse +from pfruck_contabo.models.list_instances_audit_response import ListInstancesAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = instances_audits_api.InstancesAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.InstancesAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) instance_id = 12345 # int | The identifier of the instances. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | changedBy of the user which led to the change. (optional) - start_date = dateutil_parser('2021-06-02').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-06-02').date() # date | End of search time range. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | changedBy of the user which led to the change. (optional) + start_date = '2021-06-02' # date | Start of search time range. (optional) + end_date = '2021-06-02' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your instances (audit) - api_response = api_instance.retrieve_instances_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InstancesAuditsApi->retrieve_instances_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your instances (audit) api_response = api_instance.retrieve_instances_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, instance_id=instance_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of InstancesAuditsApi->retrieve_instances_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InstancesAuditsApi->retrieve_instances_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **instance_id** | **int**| The identifier of the instances. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| changedBy of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **instance_id** | **int**| The identifier of the instances. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| changedBy of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/InstancesResetPasswordActionsRequest.md b/docs/InstancesResetPasswordActionsRequest.md index 732e5ea..3b2c86c 100644 --- a/docs/InstancesResetPasswordActionsRequest.md +++ b/docs/InstancesResetPasswordActionsRequest.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ssh_keys** | **[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | [optional] +**ssh_keys** | **List[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | [optional] **root_password** | **int** | `secretId` of the password for the `defaultUser` with administrator/root privileges. For Linux/BSD please use SSH, for Windows RDP. Please refer to Secrets Management API. | [optional] **user_data** | **str** | [Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of InstancesResetPasswordActionsRequest from a JSON string +instances_reset_password_actions_request_instance = InstancesResetPasswordActionsRequest.from_json(json) +# print the JSON string representation of the object +print(InstancesResetPasswordActionsRequest.to_json()) + +# convert the object into a dict +instances_reset_password_actions_request_dict = instances_reset_password_actions_request_instance.to_dict() +# create an instance of InstancesResetPasswordActionsRequest from a dict +instances_reset_password_actions_request_from_dict = InstancesResetPasswordActionsRequest.from_dict(instances_reset_password_actions_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/InternalApi.md b/docs/InternalApi.md index f39d2e6..0ebeede 100644 --- a/docs/InternalApi.md +++ b/docs/InternalApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **create_ticket** -> CreateTicketResponse create_ticket(x_request_id, create_ticket_request) +> CreateTicketResponse create_ticket(x_request_id, create_ticket_request, x_trace_id=x_trace_id) Create a new support ticket @@ -20,12 +20,12 @@ Create a new support ticket. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import internal_api -from pfruck_contabo.model.create_ticket_request import CreateTicketRequest -from pfruck_contabo.model.create_ticket_response import CreateTicketResponse +from pfruck_contabo.models.create_ticket_request import CreateTicketRequest +from pfruck_contabo.models.create_ticket_response import CreateTicketResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -39,47 +39,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = internal_api.InternalApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_ticket_request = CreateTicketRequest( - subject="Subject", - note="Note", - sender="your@mail.com", - ) # CreateTicketRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Create a new support ticket - api_response = api_instance.create_ticket(x_request_id, create_ticket_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InternalApi->create_ticket: %s\n" % e) + api_instance = pfruck_contabo.InternalApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_ticket_request = pfruck_contabo.CreateTicketRequest() # CreateTicketRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new support ticket api_response = api_instance.create_ticket(x_request_id, create_ticket_request, x_trace_id=x_trace_id) + print("The response of InternalApi->create_ticket:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InternalApi->create_ticket: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_ticket_request** | [**CreateTicketRequest**](CreateTicketRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_ticket_request** | [**CreateTicketRequest**](CreateTicketRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -94,7 +83,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -104,7 +92,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_user_is_password_set** -> FindUserIsPasswordSetResponse retrieve_user_is_password_set(x_request_id) +> FindUserIsPasswordSetResponse retrieve_user_is_password_set(x_request_id, x_trace_id=x_trace_id, user_id=user_id) Get user is password set status @@ -115,11 +103,11 @@ Get info about idm user if the password is set. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import internal_api -from pfruck_contabo.model.find_user_is_password_set_response import FindUserIsPasswordSetResponse +from pfruck_contabo.models.find_user_is_password_set_response import FindUserIsPasswordSetResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -133,43 +121,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = internal_api.InternalApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The user ID for checking if password is set for him (optional) + api_instance = pfruck_contabo.InternalApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The user ID for checking if password is set for him (optional) - # example passing only required values which don't have defaults set - try: - # Get user is password set status - api_response = api_instance.retrieve_user_is_password_set(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling InternalApi->retrieve_user_is_password_set: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get user is password set status api_response = api_instance.retrieve_user_is_password_set(x_request_id, x_trace_id=x_trace_id, user_id=user_id) + print("The response of InternalApi->retrieve_user_is_password_set:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling InternalApi->retrieve_user_is_password_set: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **user_id** | **str**| The user ID for checking if password is set for him | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **user_id** | **str**| The user ID for checking if password is set for him | [optional] ### Return type @@ -184,7 +165,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/IpConfig.md b/docs/IpConfig.md index 3679dc5..cb9df03 100644 --- a/docs/IpConfig.md +++ b/docs/IpConfig.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **v4** | [**IpV4**](IpV4.md) | | **v6** | [**IpV6**](IpV6.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.ip_config import IpConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of IpConfig from a JSON string +ip_config_instance = IpConfig.from_json(json) +# print the JSON string representation of the object +print(IpConfig.to_json()) + +# convert the object into a dict +ip_config_dict = ip_config_instance.to_dict() +# create an instance of IpConfig from a dict +ip_config_from_dict = IpConfig.from_dict(ip_config_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/IpV4.md b/docs/IpV4.md index 2624a81..0c6406c 100644 --- a/docs/IpV4.md +++ b/docs/IpV4.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ip** | **str** | IP Address | **netmask_cidr** | **int** | Netmask CIDR | **gateway** | **str** | Gateway | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.ip_v4 import IpV4 + +# TODO update the JSON string below +json = "{}" +# create an instance of IpV4 from a JSON string +ip_v4_instance = IpV4.from_json(json) +# print the JSON string representation of the object +print(IpV4.to_json()) + +# convert the object into a dict +ip_v4_dict = ip_v4_instance.to_dict() +# create an instance of IpV4 from a dict +ip_v4_from_dict = IpV4.from_dict(ip_v4_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/IpV6.md b/docs/IpV6.md index 4b459c0..91b8787 100644 --- a/docs/IpV6.md +++ b/docs/IpV6.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ip** | **str** | IP Address | **netmask_cidr** | **int** | Netmask CIDR | **gateway** | **str** | Gateway | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.ip_v6 import IpV6 + +# TODO update the JSON string below +json = "{}" +# create an instance of IpV6 from a JSON string +ip_v6_instance = IpV6.from_json(json) +# print the JSON string representation of the object +print(IpV6.to_json()) + +# convert the object into a dict +ip_v6_dict = ip_v6_instance.to_dict() +# create an instance of IpV6 from a dict +ip_v6_from_dict = IpV6.from_dict(ip_v6_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Links.md b/docs/Links.md index 6f2742e..1fab83d 100644 --- a/docs/Links.md +++ b/docs/Links.md @@ -2,15 +2,32 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_self** | **str** | Link to current resource. | +**var_self** | **str** | Link to current resource. | **first** | **str** | Link to first page, if applicable. | -**last** | **str** | Link to last page, if applicable. | **previous** | **str** | Link to previous page, if applicable. | [optional] **next** | **str** | Link to next page, if applicable. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**last** | **str** | Link to last page, if applicable. | + +## Example + +```python +from pfruck_contabo.models.links import Links + +# TODO update the JSON string below +json = "{}" +# create an instance of Links from a JSON string +links_instance = Links.from_json(json) +# print the JSON string representation of the object +print(Links.to_json()) +# convert the object into a dict +links_dict = links_instance.to_dict() +# create an instance of Links from a dict +links_from_dict = Links.from_dict(links_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListApiPermissionResponse.md b/docs/ListApiPermissionResponse.md index 2315020..96e0aa3 100644 --- a/docs/ListApiPermissionResponse.md +++ b/docs/ListApiPermissionResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[ApiPermissionsResponse]**](ApiPermissionsResponse.md) | | -**links** | [**ListApiPermissionResponseLinks**](ListApiPermissionResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[ApiPermissionsResponse]**](ApiPermissionsResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_api_permission_response import ListApiPermissionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListApiPermissionResponse from a JSON string +list_api_permission_response_instance = ListApiPermissionResponse.from_json(json) +# print the JSON string representation of the object +print(ListApiPermissionResponse.to_json()) +# convert the object into a dict +list_api_permission_response_dict = list_api_permission_response_instance.to_dict() +# create an instance of ListApiPermissionResponse from a dict +list_api_permission_response_from_dict = ListApiPermissionResponse.from_dict(list_api_permission_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListApplicationsResponse.md b/docs/ListApplicationsResponse.md index 5bb2cc8..e0a7cfd 100644 --- a/docs/ListApplicationsResponse.md +++ b/docs/ListApplicationsResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[ApplicationResponse]**](ApplicationResponse.md) | | -**links** | [**ListApplicationsResponseLinks**](ListApplicationsResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ApplicationResponse]**](ApplicationResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_applications_response import ListApplicationsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListApplicationsResponse from a JSON string +list_applications_response_instance = ListApplicationsResponse.from_json(json) +# print the JSON string representation of the object +print(ListApplicationsResponse.to_json()) +# convert the object into a dict +list_applications_response_dict = list_applications_response_instance.to_dict() +# create an instance of ListApplicationsResponse from a dict +list_applications_response_from_dict = ListApplicationsResponse.from_dict(list_applications_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListAssignmentAuditsResponse.md b/docs/ListAssignmentAuditsResponse.md index 7510f7d..107c389 100644 --- a/docs/ListAssignmentAuditsResponse.md +++ b/docs/ListAssignmentAuditsResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[AssignmentAuditResponse]**](AssignmentAuditResponse.md) | | -**links** | [**ListAssignmentAuditsResponseLinks**](ListAssignmentAuditsResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[AssignmentAuditResponse]**](AssignmentAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_assignment_audits_response import ListAssignmentAuditsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListAssignmentAuditsResponse from a JSON string +list_assignment_audits_response_instance = ListAssignmentAuditsResponse.from_json(json) +# print the JSON string representation of the object +print(ListAssignmentAuditsResponse.to_json()) +# convert the object into a dict +list_assignment_audits_response_dict = list_assignment_audits_response_instance.to_dict() +# create an instance of ListAssignmentAuditsResponse from a dict +list_assignment_audits_response_from_dict = ListAssignmentAuditsResponse.from_dict(list_assignment_audits_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListAssignmentResponse.md b/docs/ListAssignmentResponse.md index d9f58d6..3c77162 100644 --- a/docs/ListAssignmentResponse.md +++ b/docs/ListAssignmentResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[AssignmentResponse]**](AssignmentResponse.md) | | -**links** | [**ListAssignmentResponseLinks**](ListAssignmentResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[AssignmentResponse]**](AssignmentResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_assignment_response import ListAssignmentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListAssignmentResponse from a JSON string +list_assignment_response_instance = ListAssignmentResponse.from_json(json) +# print the JSON string representation of the object +print(ListAssignmentResponse.to_json()) +# convert the object into a dict +list_assignment_response_dict = list_assignment_response_instance.to_dict() +# create an instance of ListAssignmentResponse from a dict +list_assignment_response_from_dict = ListAssignmentResponse.from_dict(list_assignment_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListCredentialResponse.md b/docs/ListCredentialResponse.md index 0ce3bad..38a26f5 100644 --- a/docs/ListCredentialResponse.md +++ b/docs/ListCredentialResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[CredentialData]**](CredentialData.md) | | -**links** | [**ListCredentialResponseLinks**](ListCredentialResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[CredentialData]**](CredentialData.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_credential_response import ListCredentialResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListCredentialResponse from a JSON string +list_credential_response_instance = ListCredentialResponse.from_json(json) +# print the JSON string representation of the object +print(ListCredentialResponse.to_json()) +# convert the object into a dict +list_credential_response_dict = list_credential_response_instance.to_dict() +# create an instance of ListCredentialResponse from a dict +list_credential_response_from_dict = ListCredentialResponse.from_dict(list_credential_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListDataCenterResponse.md b/docs/ListDataCenterResponse.md index 2e5833b..8fac33a 100644 --- a/docs/ListDataCenterResponse.md +++ b/docs/ListDataCenterResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[DataCenterResponse]**](DataCenterResponse.md) | | -**links** | [**ListDataCenterResponseLinks**](ListDataCenterResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[DataCenterResponse]**](DataCenterResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_data_center_response import ListDataCenterResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListDataCenterResponse from a JSON string +list_data_center_response_instance = ListDataCenterResponse.from_json(json) +# print the JSON string representation of the object +print(ListDataCenterResponse.to_json()) +# convert the object into a dict +list_data_center_response_dict = list_data_center_response_instance.to_dict() +# create an instance of ListDataCenterResponse from a dict +list_data_center_response_from_dict = ListDataCenterResponse.from_dict(list_data_center_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListImageResponse.md b/docs/ListImageResponse.md index 0d18a1b..45df609 100644 --- a/docs/ListImageResponse.md +++ b/docs/ListImageResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[ListImageResponseData]**](ListImageResponseData.md) | | -**links** | [**ListImageResponseLinks**](ListImageResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ListImageResponseData]**](ListImageResponseData.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_image_response import ListImageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListImageResponse from a JSON string +list_image_response_instance = ListImageResponse.from_json(json) +# print the JSON string representation of the object +print(ListImageResponse.to_json()) +# convert the object into a dict +list_image_response_dict = list_image_response_instance.to_dict() +# create an instance of ListImageResponse from a dict +list_image_response_from_dict = ListImageResponse.from_dict(list_image_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListImageResponseData.md b/docs/ListImageResponseData.md index 8cc3da1..8e9f9d8 100644 --- a/docs/ListImageResponseData.md +++ b/docs/ListImageResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **image_id** | **str** | Image's id | @@ -20,9 +21,25 @@ Name | Type | Description | Notes **standard_image** | **bool** | Flag indicating that image is either a standard (true) or a custom image (false) | **creation_date** | **datetime** | The creation date time for the image | **last_modified_date** | **datetime** | The last modified date time for the image | -**tags** | [**[AssignedTagResponse]**](AssignedTagResponse.md) | The tags assigned to the image | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**tags** | [**List[AssignedTagResponse]**](AssignedTagResponse.md) | The tags assigned to the image | + +## Example + +```python +from pfruck_contabo.models.list_image_response_data import ListImageResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ListImageResponseData from a JSON string +list_image_response_data_instance = ListImageResponseData.from_json(json) +# print the JSON string representation of the object +print(ListImageResponseData.to_json()) +# convert the object into a dict +list_image_response_data_dict = list_image_response_data_instance.to_dict() +# create an instance of ListImageResponseData from a dict +list_image_response_data_from_dict = ListImageResponseData.from_dict(list_image_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListInstancesActionsAuditResponse.md b/docs/ListInstancesActionsAuditResponse.md index 8bbd303..fd6c53c 100644 --- a/docs/ListInstancesActionsAuditResponse.md +++ b/docs/ListInstancesActionsAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[InstancesActionsAuditResponse]**](InstancesActionsAuditResponse.md) | | -**links** | [**ListInstancesActionsAuditResponseLinks**](ListInstancesActionsAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[InstancesActionsAuditResponse]**](InstancesActionsAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_instances_actions_audit_response import ListInstancesActionsAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstancesActionsAuditResponse from a JSON string +list_instances_actions_audit_response_instance = ListInstancesActionsAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListInstancesActionsAuditResponse.to_json()) +# convert the object into a dict +list_instances_actions_audit_response_dict = list_instances_actions_audit_response_instance.to_dict() +# create an instance of ListInstancesActionsAuditResponse from a dict +list_instances_actions_audit_response_from_dict = ListInstancesActionsAuditResponse.from_dict(list_instances_actions_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListInstancesAuditResponse.md b/docs/ListInstancesAuditResponse.md index 97e755d..6137546 100644 --- a/docs/ListInstancesAuditResponse.md +++ b/docs/ListInstancesAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[InstancesAuditResponse]**](InstancesAuditResponse.md) | | -**links** | [**ListInstancesAuditResponseLinks**](ListInstancesAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[InstancesAuditResponse]**](InstancesAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_instances_audit_response import ListInstancesAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstancesAuditResponse from a JSON string +list_instances_audit_response_instance = ListInstancesAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListInstancesAuditResponse.to_json()) +# convert the object into a dict +list_instances_audit_response_dict = list_instances_audit_response_instance.to_dict() +# create an instance of ListInstancesAuditResponse from a dict +list_instances_audit_response_from_dict = ListInstancesAuditResponse.from_dict(list_instances_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListInstancesResponse.md b/docs/ListInstancesResponse.md index 2cea9e7..09fd166 100644 --- a/docs/ListInstancesResponse.md +++ b/docs/ListInstancesResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[ListInstancesResponseData]**](ListInstancesResponseData.md) | | -**links** | [**ListInstancesResponseLinks**](ListInstancesResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ListInstancesResponseData]**](ListInstancesResponseData.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_instances_response import ListInstancesResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstancesResponse from a JSON string +list_instances_response_instance = ListInstancesResponse.from_json(json) +# print the JSON string representation of the object +print(ListInstancesResponse.to_json()) +# convert the object into a dict +list_instances_response_dict = list_instances_response_instance.to_dict() +# create an instance of ListInstancesResponse from a dict +list_instances_response_from_dict = ListInstancesResponse.from_dict(list_instances_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListInstancesResponseData.md b/docs/ListInstancesResponseData.md index dbf678a..388980e 100644 --- a/docs/ListInstancesResponseData.md +++ b/docs/ListInstancesResponseData.md @@ -2,11 +2,12 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Customer ID | -**additional_ips** | [**[AdditionalIp]**](AdditionalIp.md) | | +**additional_ips** | [**List[AdditionalIp]**](AdditionalIp.md) | | **name** | **str** | Instance Name | **display_name** | **str** | Instance display name | **instance_id** | **int** | Instance ID | @@ -21,20 +22,36 @@ Name | Type | Description | Notes **cpu_cores** | **int** | CPU core count | **os_type** | **str** | Type of operating system (OS) | **disk_mb** | **float** | Image Disk size in MB | -**ssh_keys** | **[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | +**ssh_keys** | **List[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | **created_date** | **datetime** | The creation date for the instance | **cancel_date** | **date** | The date on which the instance will be cancelled | **status** | [**InstanceStatus**](InstanceStatus.md) | | **v_host_id** | **int** | ID of host system | **v_host_number** | **int** | Number of host system | **v_host_name** | **str** | Name of host system | -**add_ons** | [**[AddOnResponse]**](AddOnResponse.md) | | +**add_ons** | [**List[AddOnResponse]**](AddOnResponse.md) | | +**error_message** | **str** | Message in case of an error. | [optional] **product_type** | **str** | Instance's category depending on Product Id | **product_name** | **str** | Instance's Product Name | -**error_message** | **str** | Message in case of an error. | [optional] **default_user** | **str** | Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.list_instances_response_data import ListInstancesResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ListInstancesResponseData from a JSON string +list_instances_response_data_instance = ListInstancesResponseData.from_json(json) +# print the JSON string representation of the object +print(ListInstancesResponseData.to_json()) + +# convert the object into a dict +list_instances_response_data_dict = list_instances_response_data_instance.to_dict() +# create an instance of ListInstancesResponseData from a dict +list_instances_response_data_from_dict = ListInstancesResponseData.from_dict(list_instances_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListObjectStorageAuditResponse.md b/docs/ListObjectStorageAuditResponse.md index bec9ecf..6df906b 100644 --- a/docs/ListObjectStorageAuditResponse.md +++ b/docs/ListObjectStorageAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[ObjectStorageAuditResponse]**](ObjectStorageAuditResponse.md) | | -**links** | [**ListObjectStorageAuditResponseLinks**](ListObjectStorageAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ObjectStorageAuditResponse]**](ObjectStorageAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_object_storage_audit_response import ListObjectStorageAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListObjectStorageAuditResponse from a JSON string +list_object_storage_audit_response_instance = ListObjectStorageAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListObjectStorageAuditResponse.to_json()) +# convert the object into a dict +list_object_storage_audit_response_dict = list_object_storage_audit_response_instance.to_dict() +# create an instance of ListObjectStorageAuditResponse from a dict +list_object_storage_audit_response_from_dict = ListObjectStorageAuditResponse.from_dict(list_object_storage_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListObjectStorageResponse.md b/docs/ListObjectStorageResponse.md index ba1828e..ae74447 100644 --- a/docs/ListObjectStorageResponse.md +++ b/docs/ListObjectStorageResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[ObjectStorageResponse]**](ObjectStorageResponse.md) | | -**links** | [**ListObjectStorageResponseLinks**](ListObjectStorageResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ObjectStorageResponse]**](ObjectStorageResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_object_storage_response import ListObjectStorageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListObjectStorageResponse from a JSON string +list_object_storage_response_instance = ListObjectStorageResponse.from_json(json) +# print the JSON string representation of the object +print(ListObjectStorageResponse.to_json()) +# convert the object into a dict +list_object_storage_response_dict = list_object_storage_response_instance.to_dict() +# create an instance of ListObjectStorageResponse from a dict +list_object_storage_response_from_dict = ListObjectStorageResponse.from_dict(list_object_storage_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListPrivateNetworkAuditResponse.md b/docs/ListPrivateNetworkAuditResponse.md index 1bdeb63..3cba81a 100644 --- a/docs/ListPrivateNetworkAuditResponse.md +++ b/docs/ListPrivateNetworkAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[PrivateNetworkAuditResponse]**](PrivateNetworkAuditResponse.md) | | -**links** | [**ListPrivateNetworkAuditResponseLinks**](ListPrivateNetworkAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[PrivateNetworkAuditResponse]**](PrivateNetworkAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_private_network_audit_response import ListPrivateNetworkAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListPrivateNetworkAuditResponse from a JSON string +list_private_network_audit_response_instance = ListPrivateNetworkAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListPrivateNetworkAuditResponse.to_json()) +# convert the object into a dict +list_private_network_audit_response_dict = list_private_network_audit_response_instance.to_dict() +# create an instance of ListPrivateNetworkAuditResponse from a dict +list_private_network_audit_response_from_dict = ListPrivateNetworkAuditResponse.from_dict(list_private_network_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListPrivateNetworkResponse.md b/docs/ListPrivateNetworkResponse.md index 1bdb53e..ec1f560 100644 --- a/docs/ListPrivateNetworkResponse.md +++ b/docs/ListPrivateNetworkResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[ListPrivateNetworkResponseData]**](ListPrivateNetworkResponseData.md) | | -**links** | [**ListPrivateNetworkResponseLinks**](ListPrivateNetworkResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[ListPrivateNetworkResponseData]**](ListPrivateNetworkResponseData.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_private_network_response import ListPrivateNetworkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListPrivateNetworkResponse from a JSON string +list_private_network_response_instance = ListPrivateNetworkResponse.from_json(json) +# print the JSON string representation of the object +print(ListPrivateNetworkResponse.to_json()) +# convert the object into a dict +list_private_network_response_dict = list_private_network_response_instance.to_dict() +# create an instance of ListPrivateNetworkResponse from a dict +list_private_network_response_from_dict = ListPrivateNetworkResponse.from_dict(list_private_network_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListPrivateNetworkResponseData.md b/docs/ListPrivateNetworkResponseData.md index 3f7d841..8c40fd6 100644 --- a/docs/ListPrivateNetworkResponseData.md +++ b/docs/ListPrivateNetworkResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -15,9 +16,25 @@ Name | Type | Description | Notes **cidr** | **str** | The cidr range of the Private Network | **available_ips** | **int** | The total available IPs of the Private Network | **created_date** | **datetime** | The creation date of the Private Network | -**instances** | [**[Instances]**](Instances.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**instances** | [**List[Instances]**](Instances.md) | | + +## Example + +```python +from pfruck_contabo.models.list_private_network_response_data import ListPrivateNetworkResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ListPrivateNetworkResponseData from a JSON string +list_private_network_response_data_instance = ListPrivateNetworkResponseData.from_json(json) +# print the JSON string representation of the object +print(ListPrivateNetworkResponseData.to_json()) +# convert the object into a dict +list_private_network_response_data_dict = list_private_network_response_data_instance.to_dict() +# create an instance of ListPrivateNetworkResponseData from a dict +list_private_network_response_data_from_dict = ListPrivateNetworkResponseData.from_dict(list_private_network_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListRoleAuditResponse.md b/docs/ListRoleAuditResponse.md index fd17c0d..ca47eff 100644 --- a/docs/ListRoleAuditResponse.md +++ b/docs/ListRoleAuditResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[RoleAuditResponse]**](RoleAuditResponse.md) | | -**links** | [**ListRoleAuditResponseLinks**](ListRoleAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[RoleAuditResponse]**](RoleAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_role_audit_response import ListRoleAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListRoleAuditResponse from a JSON string +list_role_audit_response_instance = ListRoleAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListRoleAuditResponse.to_json()) +# convert the object into a dict +list_role_audit_response_dict = list_role_audit_response_instance.to_dict() +# create an instance of ListRoleAuditResponse from a dict +list_role_audit_response_from_dict = ListRoleAuditResponse.from_dict(list_role_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListRoleResponse.md b/docs/ListRoleResponse.md index 105f712..ad53fe0 100644 --- a/docs/ListRoleResponse.md +++ b/docs/ListRoleResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[RoleResponse]**](RoleResponse.md) | | -**links** | [**ListRoleResponseLinks**](ListRoleResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[RoleResponse]**](RoleResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_role_response import ListRoleResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListRoleResponse from a JSON string +list_role_response_instance = ListRoleResponse.from_json(json) +# print the JSON string representation of the object +print(ListRoleResponse.to_json()) +# convert the object into a dict +list_role_response_dict = list_role_response_instance.to_dict() +# create an instance of ListRoleResponse from a dict +list_role_response_from_dict = ListRoleResponse.from_dict(list_role_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListSecretAuditResponse.md b/docs/ListSecretAuditResponse.md index 4b74cf6..a7e5be3 100644 --- a/docs/ListSecretAuditResponse.md +++ b/docs/ListSecretAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[SecretAuditResponse]**](SecretAuditResponse.md) | | -**links** | [**ListSecretAuditResponseLinks**](ListSecretAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[SecretAuditResponse]**](SecretAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_secret_audit_response import ListSecretAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListSecretAuditResponse from a JSON string +list_secret_audit_response_instance = ListSecretAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListSecretAuditResponse.to_json()) +# convert the object into a dict +list_secret_audit_response_dict = list_secret_audit_response_instance.to_dict() +# create an instance of ListSecretAuditResponse from a dict +list_secret_audit_response_from_dict = ListSecretAuditResponse.from_dict(list_secret_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListSecretResponse.md b/docs/ListSecretResponse.md index 27272e8..4177303 100644 --- a/docs/ListSecretResponse.md +++ b/docs/ListSecretResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[SecretResponse]**](SecretResponse.md) | | -**links** | [**ListSecretResponseLinks**](ListSecretResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[SecretResponse]**](SecretResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.list_secret_response import ListSecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListSecretResponse from a JSON string +list_secret_response_instance = ListSecretResponse.from_json(json) +# print the JSON string representation of the object +print(ListSecretResponse.to_json()) +# convert the object into a dict +list_secret_response_dict = list_secret_response_instance.to_dict() +# create an instance of ListSecretResponse from a dict +list_secret_response_from_dict = ListSecretResponse.from_dict(list_secret_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListSnapshotResponse.md b/docs/ListSnapshotResponse.md index 5cff5f3..cd4e7ae 100644 --- a/docs/ListSnapshotResponse.md +++ b/docs/ListSnapshotResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[SnapshotResponse]**](SnapshotResponse.md) | | -**links** | [**ListSnapshotResponseLinks**](ListSnapshotResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[SnapshotResponse]**](SnapshotResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_snapshot_response import ListSnapshotResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListSnapshotResponse from a JSON string +list_snapshot_response_instance = ListSnapshotResponse.from_json(json) +# print the JSON string representation of the object +print(ListSnapshotResponse.to_json()) +# convert the object into a dict +list_snapshot_response_dict = list_snapshot_response_instance.to_dict() +# create an instance of ListSnapshotResponse from a dict +list_snapshot_response_from_dict = ListSnapshotResponse.from_dict(list_snapshot_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListSnapshotsAuditResponse.md b/docs/ListSnapshotsAuditResponse.md index f443316..a5135a2 100644 --- a/docs/ListSnapshotsAuditResponse.md +++ b/docs/ListSnapshotsAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[SnapshotsAuditResponse]**](SnapshotsAuditResponse.md) | | -**links** | [**ListSnapshotsAuditResponseLinks**](ListSnapshotsAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[SnapshotsAuditResponse]**](SnapshotsAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_snapshots_audit_response import ListSnapshotsAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListSnapshotsAuditResponse from a JSON string +list_snapshots_audit_response_instance = ListSnapshotsAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListSnapshotsAuditResponse.to_json()) +# convert the object into a dict +list_snapshots_audit_response_dict = list_snapshots_audit_response_instance.to_dict() +# create an instance of ListSnapshotsAuditResponse from a dict +list_snapshots_audit_response_from_dict = ListSnapshotsAuditResponse.from_dict(list_snapshots_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListTagAuditsResponse.md b/docs/ListTagAuditsResponse.md index fdf63ad..b12b57b 100644 --- a/docs/ListTagAuditsResponse.md +++ b/docs/ListTagAuditsResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[TagAuditResponse]**](TagAuditResponse.md) | | -**links** | [**ListTagAuditsResponseLinks**](ListTagAuditsResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[TagAuditResponse]**](TagAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_tag_audits_response import ListTagAuditsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListTagAuditsResponse from a JSON string +list_tag_audits_response_instance = ListTagAuditsResponse.from_json(json) +# print the JSON string representation of the object +print(ListTagAuditsResponse.to_json()) +# convert the object into a dict +list_tag_audits_response_dict = list_tag_audits_response_instance.to_dict() +# create an instance of ListTagAuditsResponse from a dict +list_tag_audits_response_from_dict = ListTagAuditsResponse.from_dict(list_tag_audits_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListTagResponse.md b/docs/ListTagResponse.md index e39345a..84ea430 100644 --- a/docs/ListTagResponse.md +++ b/docs/ListTagResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[TagResponse]**](TagResponse.md) | | -**links** | [**ListTagResponseLinks**](ListTagResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[TagResponse]**](TagResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_tag_response import ListTagResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListTagResponse from a JSON string +list_tag_response_instance = ListTagResponse.from_json(json) +# print the JSON string representation of the object +print(ListTagResponse.to_json()) +# convert the object into a dict +list_tag_response_dict = list_tag_response_instance.to_dict() +# create an instance of ListTagResponse from a dict +list_tag_response_from_dict = ListTagResponse.from_dict(list_tag_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListUserAuditResponse.md b/docs/ListUserAuditResponse.md index 4e04ace..434a376 100644 --- a/docs/ListUserAuditResponse.md +++ b/docs/ListUserAuditResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[UserAuditResponse]**](UserAuditResponse.md) | | -**links** | [**ListUserAuditResponseLinks**](ListUserAuditResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[UserAuditResponse]**](UserAuditResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_user_audit_response import ListUserAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListUserAuditResponse from a JSON string +list_user_audit_response_instance = ListUserAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ListUserAuditResponse.to_json()) +# convert the object into a dict +list_user_audit_response_dict = list_user_audit_response_instance.to_dict() +# create an instance of ListUserAuditResponse from a dict +list_user_audit_response_from_dict = ListUserAuditResponse.from_dict(list_user_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ListUserResponse.md b/docs/ListUserResponse.md index 72b744c..d80bb5f 100644 --- a/docs/ListUserResponse.md +++ b/docs/ListUserResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pagination** | [**ListInstancesResponsePagination**](ListInstancesResponsePagination.md) | | -**data** | [**[UserResponse]**](UserResponse.md) | | -**links** | [**ListUserResponseLinks**](ListUserResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**pagination** | [**PaginationMeta**](PaginationMeta.md) | Data about pagination like how many results, pages, page size. | +**data** | [**List[UserResponse]**](UserResponse.md) | | +**links** | [**Links**](Links.md) | | + +## Example + +```python +from pfruck_contabo.models.list_user_response import ListUserResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListUserResponse from a JSON string +list_user_response_instance = ListUserResponse.from_json(json) +# print the JSON string representation of the object +print(ListUserResponse.to_json()) +# convert the object into a dict +list_user_response_dict = list_user_response_instance.to_dict() +# create an instance of ListUserResponse from a dict +list_user_response_from_dict = ListUserResponse.from_dict(list_user_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/MinimumRequirements.md b/docs/MinimumRequirements.md index 6020871..75b3ead 100644 --- a/docs/MinimumRequirements.md +++ b/docs/MinimumRequirements.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cpu_cores** | **float** | CPU Cores Requirement | [optional] **ram_mb** | **float** | Memory Requirement in MB | [optional] **disk_mb** | **float** | Storage Requirement in MB | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.minimum_requirements import MinimumRequirements + +# TODO update the JSON string below +json = "{}" +# create an instance of MinimumRequirements from a JSON string +minimum_requirements_instance = MinimumRequirements.from_json(json) +# print the JSON string representation of the object +print(MinimumRequirements.to_json()) + +# convert the object into a dict +minimum_requirements_dict = minimum_requirements_instance.to_dict() +# create an instance of MinimumRequirements from a dict +minimum_requirements_from_dict = MinimumRequirements.from_dict(minimum_requirements_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ObjectStorageAuditResponse.md b/docs/ObjectStorageAuditResponse.md index d0bf1cc..2cc6593 100644 --- a/docs/ObjectStorageAuditResponse.md +++ b/docs/ObjectStorageAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The identifier of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | **object_storage_id** | **str** | Object Storage Id | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.object_storage_audit_response import ObjectStorageAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ObjectStorageAuditResponse from a JSON string +object_storage_audit_response_instance = ObjectStorageAuditResponse.from_json(json) +# print the JSON string representation of the object +print(ObjectStorageAuditResponse.to_json()) +# convert the object into a dict +object_storage_audit_response_dict = object_storage_audit_response_instance.to_dict() +# create an instance of ObjectStorageAuditResponse from a dict +object_storage_audit_response_from_dict = ObjectStorageAuditResponse.from_dict(object_storage_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ObjectStorageResponse.md b/docs/ObjectStorageResponse.md index 85c9b7a..5e64bd8 100644 --- a/docs/ObjectStorageResponse.md +++ b/docs/ObjectStorageResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -9,7 +10,7 @@ Name | Type | Description | Notes **object_storage_id** | **str** | Your object storage id | **created_date** | **datetime** | Creation date for object storage. | **cancel_date** | **date** | Cancellation date for object storage. | -**auto_scaling** | [**ObjectStorageResponseAutoScaling**](ObjectStorageResponseAutoScaling.md) | | +**auto_scaling** | [**AutoScalingTypeResponse**](AutoScalingTypeResponse.md) | Autoscaling settings | **data_center** | **str** | Data center your object storage is located | **total_purchased_space_tb** | **float** | Amount of purchased / requested object storage in TB. | **s3_url** | **str** | S3 URL to connect to your S3 compatible object storage | @@ -17,8 +18,24 @@ Name | Type | Description | Notes **status** | **str** | The object storage status | **region** | **str** | The region where your object storage is located | **display_name** | **str** | Display name for object storage. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.object_storage_response import ObjectStorageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ObjectStorageResponse from a JSON string +object_storage_response_instance = ObjectStorageResponse.from_json(json) +# print the JSON string representation of the object +print(ObjectStorageResponse.to_json()) + +# convert the object into a dict +object_storage_response_dict = object_storage_response_instance.to_dict() +# create an instance of ObjectStorageResponse from a dict +object_storage_response_from_dict = ObjectStorageResponse.from_dict(object_storage_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ObjectStoragesApi.md b/docs/ObjectStoragesApi.md index 6a89f71..59c30e8 100644 --- a/docs/ObjectStoragesApi.md +++ b/docs/ObjectStoragesApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description # **cancel_object_storage** -> CancelObjectStorageResponse cancel_object_storage(x_request_id, object_storage_id) +> CancelObjectStorageResponse cancel_object_storage(x_request_id, object_storage_id, x_trace_id=x_trace_id) Cancels the specified object storage at the next possible date @@ -26,11 +26,11 @@ Cancels the specified object storage at the next possible date. Please be aware * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.cancel_object_storage_response import CancelObjectStorageResponse +from pfruck_contabo.models.cancel_object_storage_response import CancelObjectStorageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -44,43 +44,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id = "4a6f95be-2ac0-4e3c-8eed-0dc67afed640" # str | The identifier of the object storage. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + object_storage_id = '4a6f95be-2ac0-4e3c-8eed-0dc67afed640' # str | The identifier of the object storage. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Cancels the specified object storage at the next possible date - api_response = api_instance.cancel_object_storage(x_request_id, object_storage_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->cancel_object_storage: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Cancels the specified object storage at the next possible date api_response = api_instance.cancel_object_storage(x_request_id, object_storage_id, x_trace_id=x_trace_id) + print("The response of ObjectStoragesApi->cancel_object_storage:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->cancel_object_storage: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **object_storage_id** | **str**| The identifier of the object storage. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **object_storage_id** | **str**| The identifier of the object storage. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -95,7 +88,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -105,7 +97,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_object_storage** -> CreateObjectStorageResponse create_object_storage(x_request_id, create_object_storage_request) +> CreateObjectStorageResponse create_object_storage(x_request_id, create_object_storage_request, x_trace_id=x_trace_id) Create a new object storage @@ -116,12 +108,12 @@ Create / purchase a new object storage in your account. Please note that you can * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.create_object_storage_response import CreateObjectStorageResponse -from pfruck_contabo.model.create_object_storage_request import CreateObjectStorageRequest +from pfruck_contabo.models.create_object_storage_request import CreateObjectStorageRequest +from pfruck_contabo.models.create_object_storage_response import CreateObjectStorageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -135,48 +127,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_object_storage_request = CreateObjectStorageRequest( - region="EU", - auto_scaling=CreateObjectStorageRequestAutoScaling(None), - total_purchased_space_tb=6, - display_name="Object storage 1", - ) # CreateObjectStorageRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Create a new object storage - api_response = api_instance.create_object_storage(x_request_id, create_object_storage_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->create_object_storage: %s\n" % e) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_object_storage_request = pfruck_contabo.CreateObjectStorageRequest() # CreateObjectStorageRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new object storage api_response = api_instance.create_object_storage(x_request_id, create_object_storage_request, x_trace_id=x_trace_id) + print("The response of ObjectStoragesApi->create_object_storage:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->create_object_storage: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_object_storage_request** | [**CreateObjectStorageRequest**](CreateObjectStorageRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_object_storage_request** | [**CreateObjectStorageRequest**](CreateObjectStorageRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -191,7 +171,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -201,7 +180,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_data_center_list** -> ListDataCenterResponse retrieve_data_center_list(x_request_id) +> ListDataCenterResponse retrieve_data_center_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, slug=slug, name=name, region_name=region_name, region_slug=region_slug) List data centers @@ -212,11 +191,11 @@ List all data centers and their corresponding regions. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.list_data_center_response import ListDataCenterResponse +from pfruck_contabo.models.list_data_center_response import ListDataCenterResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -230,57 +209,48 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - slug = "EU1" # str | Filter as match for data centers. (optional) - name = "European Union 1" # str | Filter for Object Storages regions. (optional) - region_name = "European Union" # str | Filter for Object Storage region names. (optional) - region_slug = "EU" # str | Filter for Object Storage region slugs. (optional) - - # example passing only required values which don't have defaults set - try: - # List data centers - api_response = api_instance.retrieve_data_center_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->retrieve_data_center_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + slug = 'EU1' # str | Filter as match for data centers. (optional) + name = 'European Union 1' # str | Filter for Object Storages regions. (optional) + region_name = 'European Union' # str | Filter for Object Storage region names. (optional) + region_slug = 'EU' # str | Filter for Object Storage region slugs. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List data centers api_response = api_instance.retrieve_data_center_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, slug=slug, name=name, region_name=region_name, region_slug=region_slug) + print("The response of ObjectStoragesApi->retrieve_data_center_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->retrieve_data_center_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **slug** | **str**| Filter as match for data centers. | [optional] - **name** | **str**| Filter for Object Storages regions. | [optional] - **region_name** | **str**| Filter for Object Storage region names. | [optional] - **region_slug** | **str**| Filter for Object Storage region slugs. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **slug** | **str**| Filter as match for data centers. | [optional] + **name** | **str**| Filter for Object Storages regions. | [optional] + **region_name** | **str**| Filter for Object Storage region names. | [optional] + **region_slug** | **str**| Filter for Object Storage region slugs. | [optional] ### Return type @@ -295,7 +265,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -305,7 +274,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_object_storage** -> FindObjectStorageResponse retrieve_object_storage(x_request_id, object_storage_id) +> FindObjectStorageResponse retrieve_object_storage(x_request_id, object_storage_id, x_trace_id=x_trace_id) Get specific object storage by its id @@ -316,11 +285,11 @@ Get data for a specific object storage on your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.find_object_storage_response import FindObjectStorageResponse +from pfruck_contabo.models.find_object_storage_response import FindObjectStorageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -334,43 +303,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id = "4a6f95be-2ac0-4e3c-8eed-0dc67afed640" # str | The identifier of the object storage. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + object_storage_id = '4a6f95be-2ac0-4e3c-8eed-0dc67afed640' # str | The identifier of the object storage. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get specific object storage by its id - api_response = api_instance.retrieve_object_storage(x_request_id, object_storage_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->retrieve_object_storage: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get specific object storage by its id api_response = api_instance.retrieve_object_storage(x_request_id, object_storage_id, x_trace_id=x_trace_id) + print("The response of ObjectStoragesApi->retrieve_object_storage:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->retrieve_object_storage: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **object_storage_id** | **str**| The identifier of the object storage. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **object_storage_id** | **str**| The identifier of the object storage. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -385,7 +347,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -395,7 +356,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_object_storage_list** -> ListObjectStorageResponse retrieve_object_storage_list(x_request_id) +> ListObjectStorageResponse retrieve_object_storage_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, data_center_name=data_center_name, s3_tenant_id=s3_tenant_id, region=region, display_name=display_name) List all your object storages @@ -406,11 +367,11 @@ List and filter all object storages in your account * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.list_object_storage_response import ListObjectStorageResponse +from pfruck_contabo.models.list_object_storage_response import ListObjectStorageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -424,57 +385,48 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - data_center_name = "European Union 2" # str | Filter for Object Storage locations. (optional) - s3_tenant_id = "2cd2e5e1444a41b0bed16c6410ecaa84" # str | Filter for Object Storage S3 tenantId. (optional) - region = "EU" # str | Filter for Object Storage by regions. Available regions: EU, US-central, SIN (optional) - display_name = "MyObjectStorage" # str | Filter for Object Storage by display name. (optional) - - # example passing only required values which don't have defaults set - try: - # List all your object storages - api_response = api_instance.retrieve_object_storage_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->retrieve_object_storage_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + data_center_name = 'European Union 2' # str | Filter for Object Storage locations. (optional) + s3_tenant_id = '2cd2e5e1444a41b0bed16c6410ecaa84' # str | Filter for Object Storage S3 tenantId. (optional) + region = 'EU' # str | Filter for Object Storage by regions. Available regions: EU, US-central, SIN (optional) + display_name = 'MyObjectStorage' # str | Filter for Object Storage by display name. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List all your object storages api_response = api_instance.retrieve_object_storage_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, data_center_name=data_center_name, s3_tenant_id=s3_tenant_id, region=region, display_name=display_name) + print("The response of ObjectStoragesApi->retrieve_object_storage_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->retrieve_object_storage_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **data_center_name** | **str**| Filter for Object Storage locations. | [optional] - **s3_tenant_id** | **str**| Filter for Object Storage S3 tenantId. | [optional] - **region** | **str**| Filter for Object Storage by regions. Available regions: EU, US-central, SIN | [optional] - **display_name** | **str**| Filter for Object Storage by display name. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **data_center_name** | **str**| Filter for Object Storage locations. | [optional] + **s3_tenant_id** | **str**| Filter for Object Storage S3 tenantId. | [optional] + **region** | **str**| Filter for Object Storage by regions. Available regions: EU, US-central, SIN | [optional] + **display_name** | **str**| Filter for Object Storage by display name. | [optional] ### Return type @@ -489,7 +441,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -499,7 +450,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_object_storages_stats** -> ObjectStoragesStatsResponse retrieve_object_storages_stats(x_request_id, object_storage_id) +> ObjectStoragesStatsResponse retrieve_object_storages_stats(x_request_id, object_storage_id, x_trace_id=x_trace_id) List usage statistics about the specified object storage @@ -510,11 +461,11 @@ List usage statistics about the specified object storage such as the number of o * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.object_storages_stats_response import ObjectStoragesStatsResponse +from pfruck_contabo.models.object_storages_stats_response import ObjectStoragesStatsResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -528,43 +479,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id = "4a6f95be-2ac0-4e3c-8eed-0dc67afed640" # str | The identifier of the object storage. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + object_storage_id = '4a6f95be-2ac0-4e3c-8eed-0dc67afed640' # str | The identifier of the object storage. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # List usage statistics about the specified object storage - api_response = api_instance.retrieve_object_storages_stats(x_request_id, object_storage_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->retrieve_object_storages_stats: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List usage statistics about the specified object storage api_response = api_instance.retrieve_object_storages_stats(x_request_id, object_storage_id, x_trace_id=x_trace_id) + print("The response of ObjectStoragesApi->retrieve_object_storages_stats:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->retrieve_object_storages_stats: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **object_storage_id** | **str**| The identifier of the object storage. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **object_storage_id** | **str**| The identifier of the object storage. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -579,7 +523,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -589,7 +532,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_object_storage** -> CancelObjectStorageResponse update_object_storage(x_request_id, object_storage_id, patch_object_storage_request) +> CancelObjectStorageResponse update_object_storage(x_request_id, object_storage_id, patch_object_storage_request, x_trace_id=x_trace_id) Modifies the display name of object storage @@ -600,12 +543,12 @@ Modifies the display name of object storage. Display name must be unique. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.patch_object_storage_request import PatchObjectStorageRequest -from pfruck_contabo.model.cancel_object_storage_response import CancelObjectStorageResponse +from pfruck_contabo.models.cancel_object_storage_response import CancelObjectStorageResponse +from pfruck_contabo.models.patch_object_storage_request import PatchObjectStorageRequest +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -619,47 +562,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id = "4a6f95be-2ac0-4e3c-8eed-0dc67afed640" # str | The identifier of the object storage. - patch_object_storage_request = PatchObjectStorageRequest( - display_name="Object storage 1", - ) # PatchObjectStorageRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Modifies the display name of object storage - api_response = api_instance.update_object_storage(x_request_id, object_storage_id, patch_object_storage_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->update_object_storage: %s\n" % e) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + object_storage_id = '4a6f95be-2ac0-4e3c-8eed-0dc67afed640' # str | The identifier of the object storage. + patch_object_storage_request = pfruck_contabo.PatchObjectStorageRequest() # PatchObjectStorageRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Modifies the display name of object storage api_response = api_instance.update_object_storage(x_request_id, object_storage_id, patch_object_storage_request, x_trace_id=x_trace_id) + print("The response of ObjectStoragesApi->update_object_storage:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->update_object_storage: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **object_storage_id** | **str**| The identifier of the object storage. | - **patch_object_storage_request** | [**PatchObjectStorageRequest**](PatchObjectStorageRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **object_storage_id** | **str**| The identifier of the object storage. | + **patch_object_storage_request** | [**PatchObjectStorageRequest**](PatchObjectStorageRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -674,7 +608,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -684,7 +617,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upgrade_object_storage** -> UpgradeObjectStorageResponse upgrade_object_storage(x_request_id, object_storage_id, upgrade_object_storage_request) +> UpgradeObjectStorageResponse upgrade_object_storage(x_request_id, object_storage_id, upgrade_object_storage_request, x_trace_id=x_trace_id) Upgrade object storage size resp. update autoscaling settings. @@ -695,12 +628,12 @@ Upgrade object storage size. You can also adjust the autoscaling settings for yo * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_api -from pfruck_contabo.model.upgrade_object_storage_request import UpgradeObjectStorageRequest -from pfruck_contabo.model.upgrade_object_storage_response import UpgradeObjectStorageResponse +from pfruck_contabo.models.upgrade_object_storage_request import UpgradeObjectStorageRequest +from pfruck_contabo.models.upgrade_object_storage_response import UpgradeObjectStorageResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -714,48 +647,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_api.ObjectStoragesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id = "4a6f95be-2ac0-4e3c-8eed-0dc67afed640" # str | The identifier of the object storage. - upgrade_object_storage_request = UpgradeObjectStorageRequest( - auto_scaling=UpgradeObjectStorageRequestAutoScaling(None), - total_purchased_space_tb=8, - ) # UpgradeObjectStorageRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Upgrade object storage size resp. update autoscaling settings. - api_response = api_instance.upgrade_object_storage(x_request_id, object_storage_id, upgrade_object_storage_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesApi->upgrade_object_storage: %s\n" % e) + api_instance = pfruck_contabo.ObjectStoragesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + object_storage_id = '4a6f95be-2ac0-4e3c-8eed-0dc67afed640' # str | The identifier of the object storage. + upgrade_object_storage_request = pfruck_contabo.UpgradeObjectStorageRequest() # UpgradeObjectStorageRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Upgrade object storage size resp. update autoscaling settings. api_response = api_instance.upgrade_object_storage(x_request_id, object_storage_id, upgrade_object_storage_request, x_trace_id=x_trace_id) + print("The response of ObjectStoragesApi->upgrade_object_storage:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesApi->upgrade_object_storage: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **object_storage_id** | **str**| The identifier of the object storage. | - **upgrade_object_storage_request** | [**UpgradeObjectStorageRequest**](UpgradeObjectStorageRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **object_storage_id** | **str**| The identifier of the object storage. | + **upgrade_object_storage_request** | [**UpgradeObjectStorageRequest**](UpgradeObjectStorageRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -770,7 +693,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ObjectStoragesAuditsApi.md b/docs/ObjectStoragesAuditsApi.md index ab67c31..3a74146 100644 --- a/docs/ObjectStoragesAuditsApi.md +++ b/docs/ObjectStoragesAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_object_storage_audits_list** -> ListObjectStorageAuditResponse retrieve_object_storage_audits_list(x_request_id) +> ListObjectStorageAuditResponse retrieve_object_storage_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, object_storage_id=object_storage_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your object storages (audit) @@ -19,11 +19,11 @@ List and filters the history about your object storages. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import object_storages_audits_api -from pfruck_contabo.model.list_object_storage_audit_response import ListObjectStorageAuditResponse +from pfruck_contabo.models.list_object_storage_audit_response import ListObjectStorageAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = object_storages_audits_api.ObjectStoragesAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ObjectStoragesAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - object_storage_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the object storage. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | changedBy of the user which led to the change. (optional) - start_date = dateutil_parser('2021-01-01').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-01-01').date() # date | End of search time range. (optional) - - # example passing only required values which don't have defaults set - try: - # List history about your object storages (audit) - api_response = api_instance.retrieve_object_storage_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling ObjectStoragesAuditsApi->retrieve_object_storage_audits_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + object_storage_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the object storage. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | changedBy of the user which led to the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2021-01-01' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List history about your object storages (audit) api_response = api_instance.retrieve_object_storage_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, object_storage_id=object_storage_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of ObjectStoragesAuditsApi->retrieve_object_storage_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling ObjectStoragesAuditsApi->retrieve_object_storage_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **object_storage_id** | **str**| The identifier of the object storage. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| changedBy of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **object_storage_id** | **str**| The identifier of the object storage. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| changedBy of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ObjectStoragesStatsResponse.md b/docs/ObjectStoragesStatsResponse.md index 801e870..295b1c1 100644 --- a/docs/ObjectStoragesStatsResponse.md +++ b/docs/ObjectStoragesStatsResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[ObjectStoragesStatsResponseData]**](ObjectStoragesStatsResponseData.md) | | -**links** | [**ObjectStoragesStatsResponseLinks**](ObjectStoragesStatsResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[ObjectStoragesStatsResponseData]**](ObjectStoragesStatsResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.object_storages_stats_response import ObjectStoragesStatsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ObjectStoragesStatsResponse from a JSON string +object_storages_stats_response_instance = ObjectStoragesStatsResponse.from_json(json) +# print the JSON string representation of the object +print(ObjectStoragesStatsResponse.to_json()) +# convert the object into a dict +object_storages_stats_response_dict = object_storages_stats_response_instance.to_dict() +# create an instance of ObjectStoragesStatsResponse from a dict +object_storages_stats_response_from_dict = ObjectStoragesStatsResponse.from_dict(object_storages_stats_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ObjectStoragesStatsResponseData.md b/docs/ObjectStoragesStatsResponseData.md index 1ef2a38..5bbe06f 100644 --- a/docs/ObjectStoragesStatsResponseData.md +++ b/docs/ObjectStoragesStatsResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -9,8 +10,24 @@ Name | Type | Description | Notes **used_space_tb** | **float** | Currently used space in TB. | **used_space_percentage** | **float** | Currently used space in percentage. | **number_of_objects** | **int** | Number of all objects (i.e. files and folders) in object storage. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.object_storages_stats_response_data import ObjectStoragesStatsResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ObjectStoragesStatsResponseData from a JSON string +object_storages_stats_response_data_instance = ObjectStoragesStatsResponseData.from_json(json) +# print the JSON string representation of the object +print(ObjectStoragesStatsResponseData.to_json()) + +# convert the object into a dict +object_storages_stats_response_data_dict = object_storages_stats_response_data_instance.to_dict() +# create an instance of ObjectStoragesStatsResponseData from a dict +object_storages_stats_response_data_from_dict = ObjectStoragesStatsResponseData.from_dict(object_storages_stats_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OptimalRequirements.md b/docs/OptimalRequirements.md index 6770960..a1c3f02 100644 --- a/docs/OptimalRequirements.md +++ b/docs/OptimalRequirements.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cpu_cores** | **float** | CPU Cores Requirement | [optional] **ram_mb** | **float** | Memory Requirement in MB | [optional] **disk_mb** | **float** | Storage Requirement in MB | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.optimal_requirements import OptimalRequirements + +# TODO update the JSON string below +json = "{}" +# create an instance of OptimalRequirements from a JSON string +optimal_requirements_instance = OptimalRequirements.from_json(json) +# print the JSON string representation of the object +print(OptimalRequirements.to_json()) + +# convert the object into a dict +optimal_requirements_dict = optimal_requirements_instance.to_dict() +# create an instance of OptimalRequirements from a dict +optimal_requirements_from_dict = OptimalRequirements.from_dict(optimal_requirements_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PaginationMeta.md b/docs/PaginationMeta.md index 220cd86..54c07da 100644 --- a/docs/PaginationMeta.md +++ b/docs/PaginationMeta.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **size** | **float** | Number of elements per page. | **total_elements** | **float** | Number of overall matched elements. | **total_pages** | **float** | Overall number of pages. | **page** | **float** | Current number of page. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.pagination_meta import PaginationMeta + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationMeta from a JSON string +pagination_meta_instance = PaginationMeta.from_json(json) +# print the JSON string representation of the object +print(PaginationMeta.to_json()) + +# convert the object into a dict +pagination_meta_dict = pagination_meta_instance.to_dict() +# create an instance of PaginationMeta from a dict +pagination_meta_from_dict = PaginationMeta.from_dict(pagination_meta_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchInstanceRequest.md b/docs/PatchInstanceRequest.md index 413b7c1..c07fe4f 100644 --- a/docs/PatchInstanceRequest.md +++ b/docs/PatchInstanceRequest.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **display_name** | **str** | The display name of the instance | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.patch_instance_request import PatchInstanceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchInstanceRequest from a JSON string +patch_instance_request_instance = PatchInstanceRequest.from_json(json) +# print the JSON string representation of the object +print(PatchInstanceRequest.to_json()) + +# convert the object into a dict +patch_instance_request_dict = patch_instance_request_instance.to_dict() +# create an instance of PatchInstanceRequest from a dict +patch_instance_request_from_dict = PatchInstanceRequest.from_dict(patch_instance_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchInstanceResponse.md b/docs/PatchInstanceResponse.md index 6fdab2c..8833286 100644 --- a/docs/PatchInstanceResponse.md +++ b/docs/PatchInstanceResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[PatchInstanceResponseData]**](PatchInstanceResponseData.md) | | -**links** | [**PatchInstanceResponseLinks**](PatchInstanceResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[PatchInstanceResponseData]**](PatchInstanceResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchInstanceResponse from a JSON string +patch_instance_response_instance = PatchInstanceResponse.from_json(json) +# print the JSON string representation of the object +print(PatchInstanceResponse.to_json()) +# convert the object into a dict +patch_instance_response_dict = patch_instance_response_instance.to_dict() +# create an instance of PatchInstanceResponse from a dict +patch_instance_response_from_dict = PatchInstanceResponse.from_dict(patch_instance_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchInstanceResponseData.md b/docs/PatchInstanceResponseData.md index b3df955..8d986d3 100644 --- a/docs/PatchInstanceResponseData.md +++ b/docs/PatchInstanceResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Instance's id | **created_date** | **datetime** | Creation date of the instance | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.patch_instance_response_data import PatchInstanceResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchInstanceResponseData from a JSON string +patch_instance_response_data_instance = PatchInstanceResponseData.from_json(json) +# print the JSON string representation of the object +print(PatchInstanceResponseData.to_json()) + +# convert the object into a dict +patch_instance_response_data_dict = patch_instance_response_data_instance.to_dict() +# create an instance of PatchInstanceResponseData from a dict +patch_instance_response_data_from_dict = PatchInstanceResponseData.from_dict(patch_instance_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchObjectStorageRequest.md b/docs/PatchObjectStorageRequest.md index 233dace..8150df4 100644 --- a/docs/PatchObjectStorageRequest.md +++ b/docs/PatchObjectStorageRequest.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **display_name** | **str** | Display name helps to differentiate between object storages, especially if they are in the same region. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.patch_object_storage_request import PatchObjectStorageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchObjectStorageRequest from a JSON string +patch_object_storage_request_instance = PatchObjectStorageRequest.from_json(json) +# print the JSON string representation of the object +print(PatchObjectStorageRequest.to_json()) + +# convert the object into a dict +patch_object_storage_request_dict = patch_object_storage_request_instance.to_dict() +# create an instance of PatchObjectStorageRequest from a dict +patch_object_storage_request_from_dict = PatchObjectStorageRequest.from_dict(patch_object_storage_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchPrivateNetworkRequest.md b/docs/PatchPrivateNetworkRequest.md index b12d9d2..f966492 100644 --- a/docs/PatchPrivateNetworkRequest.md +++ b/docs/PatchPrivateNetworkRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the Private Network. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per Private Network. | [optional] **description** | **str** | The description of the Private Network. There is a limit of 255 characters per Private Network. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.patch_private_network_request import PatchPrivateNetworkRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchPrivateNetworkRequest from a JSON string +patch_private_network_request_instance = PatchPrivateNetworkRequest.from_json(json) +# print the JSON string representation of the object +print(PatchPrivateNetworkRequest.to_json()) + +# convert the object into a dict +patch_private_network_request_dict = patch_private_network_request_instance.to_dict() +# create an instance of PatchPrivateNetworkRequest from a dict +patch_private_network_request_from_dict = PatchPrivateNetworkRequest.from_dict(patch_private_network_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchPrivateNetworkResponse.md b/docs/PatchPrivateNetworkResponse.md index aab7755..03bd198 100644 --- a/docs/PatchPrivateNetworkResponse.md +++ b/docs/PatchPrivateNetworkResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[PrivateNetworkResponse]**](PrivateNetworkResponse.md) | | -**links** | [**CreatePrivateNetworkResponseLinks**](CreatePrivateNetworkResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[PrivateNetworkResponse]**](PrivateNetworkResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.patch_private_network_response import PatchPrivateNetworkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchPrivateNetworkResponse from a JSON string +patch_private_network_response_instance = PatchPrivateNetworkResponse.from_json(json) +# print the JSON string representation of the object +print(PatchPrivateNetworkResponse.to_json()) +# convert the object into a dict +patch_private_network_response_dict = patch_private_network_response_instance.to_dict() +# create an instance of PatchPrivateNetworkResponse from a dict +patch_private_network_response_from_dict = PatchPrivateNetworkResponse.from_dict(patch_private_network_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PatchVncRequest.md b/docs/PatchVncRequest.md index 8e5450e..70cb9ab 100644 --- a/docs/PatchVncRequest.md +++ b/docs/PatchVncRequest.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **vnc_password** | **str** | Password for instance VNC | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.patch_vnc_request import PatchVncRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PatchVncRequest from a JSON string +patch_vnc_request_instance = PatchVncRequest.from_json(json) +# print the JSON string representation of the object +print(PatchVncRequest.to_json()) + +# convert the object into a dict +patch_vnc_request_dict = patch_vnc_request_instance.to_dict() +# create an instance of PatchVncRequest from a dict +patch_vnc_request_from_dict = PatchVncRequest.from_dict(patch_vnc_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PermissionRequest.md b/docs/PermissionRequest.md index 8bfeb32..4a41657 100644 --- a/docs/PermissionRequest.md +++ b/docs/PermissionRequest.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_name** | **str** | The name of the role. There is a limit of 255 characters per role. | -**actions** | **[str]** | Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints. | -**resources** | **[int]** | The IDs of tags. Only if those tags are assgined to a resource the user with that role will be able to access the resource. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**actions** | **List[str]** | Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints. | +**resources** | **List[int]** | The IDs of tags. Only if those tags are assgined to a resource the user with that role will be able to access the resource. | [optional] + +## Example + +```python +from pfruck_contabo.models.permission_request import PermissionRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PermissionRequest from a JSON string +permission_request_instance = PermissionRequest.from_json(json) +# print the JSON string representation of the object +print(PermissionRequest.to_json()) +# convert the object into a dict +permission_request_dict = permission_request_instance.to_dict() +# create an instance of PermissionRequest from a dict +permission_request_from_dict = PermissionRequest.from_dict(permission_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PermissionResponse.md b/docs/PermissionResponse.md index 6ca473b..8925f0d 100644 --- a/docs/PermissionResponse.md +++ b/docs/PermissionResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_name** | **str** | API endpoint. In order to get a list availbale api enpoints please refer to the GET api-permissions endpoint. | -**actions** | **[str]** | Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints. | -**resources** | [**[ResourcePermissionsResponse]**](ResourcePermissionsResponse.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**actions** | **List[str]** | Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints. | +**resources** | [**List[ResourcePermissionsResponse]**](ResourcePermissionsResponse.md) | | [optional] + +## Example + +```python +from pfruck_contabo.models.permission_response import PermissionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PermissionResponse from a JSON string +permission_response_instance = PermissionResponse.from_json(json) +# print the JSON string representation of the object +print(PermissionResponse.to_json()) +# convert the object into a dict +permission_response_dict = permission_response_instance.to_dict() +# create an instance of PermissionResponse from a dict +permission_response_from_dict = PermissionResponse.from_dict(permission_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PrivateIpConfig.md b/docs/PrivateIpConfig.md index 2c44ef4..76dc4e4 100644 --- a/docs/PrivateIpConfig.md +++ b/docs/PrivateIpConfig.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**v4** | [**[IpV4]**](IpV4.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**v4** | [**List[IpV4]**](IpV4.md) | | + +## Example + +```python +from pfruck_contabo.models.private_ip_config import PrivateIpConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of PrivateIpConfig from a JSON string +private_ip_config_instance = PrivateIpConfig.from_json(json) +# print the JSON string representation of the object +print(PrivateIpConfig.to_json()) +# convert the object into a dict +private_ip_config_dict = private_ip_config_instance.to_dict() +# create an instance of PrivateIpConfig from a dict +private_ip_config_from_dict = PrivateIpConfig.from_dict(private_ip_config_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PrivateNetworkAuditResponse.md b/docs/PrivateNetworkAuditResponse.md index 5f5f469..6cf2015 100644 --- a/docs/PrivateNetworkAuditResponse.md +++ b/docs/PrivateNetworkAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The identifier of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **username** | **str** | User name which did the change. | **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.private_network_audit_response import PrivateNetworkAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PrivateNetworkAuditResponse from a JSON string +private_network_audit_response_instance = PrivateNetworkAuditResponse.from_json(json) +# print the JSON string representation of the object +print(PrivateNetworkAuditResponse.to_json()) +# convert the object into a dict +private_network_audit_response_dict = private_network_audit_response_instance.to_dict() +# create an instance of PrivateNetworkAuditResponse from a dict +private_network_audit_response_from_dict = PrivateNetworkAuditResponse.from_dict(private_network_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PrivateNetworkResponse.md b/docs/PrivateNetworkResponse.md index 085fb64..d12e081 100644 --- a/docs/PrivateNetworkResponse.md +++ b/docs/PrivateNetworkResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -15,9 +16,25 @@ Name | Type | Description | Notes **cidr** | **str** | The cidr range of the Private Network | **available_ips** | **int** | The total available IPs of the Private Network | **created_date** | **datetime** | The creation date of the Private Network | -**instances** | [**[Instances]**](Instances.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**instances** | [**List[Instances]**](Instances.md) | | + +## Example + +```python +from pfruck_contabo.models.private_network_response import PrivateNetworkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PrivateNetworkResponse from a JSON string +private_network_response_instance = PrivateNetworkResponse.from_json(json) +# print the JSON string representation of the object +print(PrivateNetworkResponse.to_json()) +# convert the object into a dict +private_network_response_dict = private_network_response_instance.to_dict() +# create an instance of PrivateNetworkResponse from a dict +private_network_response_from_dict = PrivateNetworkResponse.from_dict(private_network_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PrivateNetworksApi.md b/docs/PrivateNetworksApi.md index b7cc25d..c6058c4 100644 --- a/docs/PrivateNetworksApi.md +++ b/docs/PrivateNetworksApi.md @@ -14,7 +14,7 @@ Method | HTTP request | Description # **assign_instance_private_network** -> AssignInstancePrivateNetworkResponse assign_instance_private_network(x_request_id, private_network_id, instance_id) +> AssignInstancePrivateNetworkResponse assign_instance_private_network(x_request_id, private_network_id, instance_id, x_trace_id=x_trace_id) Add instance to a Private Network @@ -25,11 +25,11 @@ Add a specific instance to a Private Network * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_api -from pfruck_contabo.model.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse +from pfruck_contabo.models.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -43,45 +43,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_api.PrivateNetworksApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.PrivateNetworksApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. private_network_id = 12345 # int | The identifier of the Private Network instance_id = 100 # int | The identifier of the instance - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Add instance to a Private Network - api_response = api_instance.assign_instance_private_network(x_request_id, private_network_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksApi->assign_instance_private_network: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Add instance to a Private Network api_response = api_instance.assign_instance_private_network(x_request_id, private_network_id, instance_id, x_trace_id=x_trace_id) + print("The response of PrivateNetworksApi->assign_instance_private_network:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksApi->assign_instance_private_network: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **private_network_id** | **int**| The identifier of the Private Network | - **instance_id** | **int**| The identifier of the instance | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **private_network_id** | **int**| The identifier of the Private Network | + **instance_id** | **int**| The identifier of the instance | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -96,7 +89,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -106,7 +98,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_private_network** -> CreatePrivateNetworkResponse create_private_network(x_request_id, create_private_network_request) +> CreatePrivateNetworkResponse create_private_network(x_request_id, create_private_network_request, x_trace_id=x_trace_id) Create a new Private Network @@ -117,12 +109,12 @@ Create a new Private Network in your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_api -from pfruck_contabo.model.create_private_network_request import CreatePrivateNetworkRequest -from pfruck_contabo.model.create_private_network_response import CreatePrivateNetworkResponse +from pfruck_contabo.models.create_private_network_request import CreatePrivateNetworkRequest +from pfruck_contabo.models.create_private_network_response import CreatePrivateNetworkResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -136,47 +128,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_api.PrivateNetworksApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_private_network_request = CreatePrivateNetworkRequest( - region="EU", - name="myPrivateNetwork", - description="myPrivateNetwork Description", - ) # CreatePrivateNetworkRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Create a new Private Network - api_response = api_instance.create_private_network(x_request_id, create_private_network_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksApi->create_private_network: %s\n" % e) + api_instance = pfruck_contabo.PrivateNetworksApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_private_network_request = pfruck_contabo.CreatePrivateNetworkRequest() # CreatePrivateNetworkRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new Private Network api_response = api_instance.create_private_network(x_request_id, create_private_network_request, x_trace_id=x_trace_id) + print("The response of PrivateNetworksApi->create_private_network:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksApi->create_private_network: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_private_network_request** | [**CreatePrivateNetworkRequest**](CreatePrivateNetworkRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_private_network_request** | [**CreatePrivateNetworkRequest**](CreatePrivateNetworkRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -191,7 +172,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -201,7 +181,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_private_network** -> delete_private_network(x_request_id, private_network_id) +> delete_private_network(x_request_id, private_network_id, x_trace_id=x_trace_id) Delete existing Private Network by id @@ -212,10 +192,10 @@ Delete existing Virtual Private Cloud by id and automatically unassign all insta * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -229,41 +209,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_api.PrivateNetworksApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.PrivateNetworksApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. private_network_id = 12345 # int | The identifier of the Private Network - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete existing Private Network by id - api_instance.delete_private_network(x_request_id, private_network_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksApi->delete_private_network: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete existing Private Network by id api_instance.delete_private_network(x_request_id, private_network_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksApi->delete_private_network: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **private_network_id** | **int**| The identifier of the Private Network | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **private_network_id** | **int**| The identifier of the Private Network | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -278,7 +251,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -288,7 +260,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **patch_private_network** -> PatchPrivateNetworkResponse patch_private_network(x_request_id, private_network_id, patch_private_network_request) +> PatchPrivateNetworkResponse patch_private_network(x_request_id, private_network_id, patch_private_network_request, x_trace_id=x_trace_id) Update a Private Network by id @@ -299,12 +271,12 @@ Update a Private Network by id in your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_api -from pfruck_contabo.model.patch_private_network_response import PatchPrivateNetworkResponse -from pfruck_contabo.model.patch_private_network_request import PatchPrivateNetworkRequest +from pfruck_contabo.models.patch_private_network_request import PatchPrivateNetworkRequest +from pfruck_contabo.models.patch_private_network_response import PatchPrivateNetworkResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -318,48 +290,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_api.PrivateNetworksApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.PrivateNetworksApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. private_network_id = 12345 # int | The identifier of the Private Network - patch_private_network_request = PatchPrivateNetworkRequest( - name="myPrivateNetwork", - description="myPrivateNetwork Description", - ) # PatchPrivateNetworkRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update a Private Network by id - api_response = api_instance.patch_private_network(x_request_id, private_network_id, patch_private_network_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksApi->patch_private_network: %s\n" % e) + patch_private_network_request = pfruck_contabo.PatchPrivateNetworkRequest() # PatchPrivateNetworkRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update a Private Network by id api_response = api_instance.patch_private_network(x_request_id, private_network_id, patch_private_network_request, x_trace_id=x_trace_id) + print("The response of PrivateNetworksApi->patch_private_network:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksApi->patch_private_network: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **private_network_id** | **int**| The identifier of the Private Network | - **patch_private_network_request** | [**PatchPrivateNetworkRequest**](PatchPrivateNetworkRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **private_network_id** | **int**| The identifier of the Private Network | + **patch_private_network_request** | [**PatchPrivateNetworkRequest**](PatchPrivateNetworkRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -374,7 +336,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -384,7 +345,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_private_network** -> FindPrivateNetworkResponse retrieve_private_network(x_request_id, private_network_id) +> FindPrivateNetworkResponse retrieve_private_network(x_request_id, private_network_id, x_trace_id=x_trace_id) Get specific Private Network by id @@ -395,11 +356,11 @@ Get attributes values to a specific Private Network on your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_api -from pfruck_contabo.model.find_private_network_response import FindPrivateNetworkResponse +from pfruck_contabo.models.find_private_network_response import FindPrivateNetworkResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -413,43 +374,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_api.PrivateNetworksApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.PrivateNetworksApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. private_network_id = 12345 # int | The identifier of the Private Network - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get specific Private Network by id - api_response = api_instance.retrieve_private_network(x_request_id, private_network_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksApi->retrieve_private_network: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get specific Private Network by id api_response = api_instance.retrieve_private_network(x_request_id, private_network_id, x_trace_id=x_trace_id) + print("The response of PrivateNetworksApi->retrieve_private_network:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksApi->retrieve_private_network: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **private_network_id** | **int**| The identifier of the Private Network | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **private_network_id** | **int**| The identifier of the Private Network | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -464,7 +418,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -474,7 +427,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_private_network_list** -> ListPrivateNetworkResponse retrieve_private_network_list(x_request_id) +> ListPrivateNetworkResponse retrieve_private_network_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, instance_ids=instance_ids, region=region, data_center=data_center) List Private Networks @@ -485,11 +438,11 @@ List and filter all Private Networks in your account * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_api -from pfruck_contabo.model.list_private_network_response import ListPrivateNetworkResponse +from pfruck_contabo.models.list_private_network_response import ListPrivateNetworkResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -503,57 +456,48 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_api.PrivateNetworksApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.PrivateNetworksApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - name = "myPrivateNetwork" # str | The name of the Private Network (optional) - instance_ids = "100, 101, 102" # str | Comma separated instances identifiers (optional) - region = "EU" # str | The slug of the region where your Private Network is located (optional) - data_center = "European Union 1" # str | The data center where your Private Network is located (optional) - - # example passing only required values which don't have defaults set - try: - # List Private Networks - api_response = api_instance.retrieve_private_network_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksApi->retrieve_private_network_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + name = 'myPrivateNetwork' # str | The name of the Private Network (optional) + instance_ids = '100, 101, 102' # str | Comma separated instances identifiers (optional) + region = 'EU' # str | The slug of the region where your Private Network is located (optional) + data_center = 'European Union 1' # str | The data center where your Private Network is located (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List Private Networks api_response = api_instance.retrieve_private_network_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, instance_ids=instance_ids, region=region, data_center=data_center) + print("The response of PrivateNetworksApi->retrieve_private_network_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksApi->retrieve_private_network_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **name** | **str**| The name of the Private Network | [optional] - **instance_ids** | **str**| Comma separated instances identifiers | [optional] - **region** | **str**| The slug of the region where your Private Network is located | [optional] - **data_center** | **str**| The data center where your Private Network is located | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **name** | **str**| The name of the Private Network | [optional] + **instance_ids** | **str**| Comma separated instances identifiers | [optional] + **region** | **str**| The slug of the region where your Private Network is located | [optional] + **data_center** | **str**| The data center where your Private Network is located | [optional] ### Return type @@ -568,7 +512,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -578,7 +521,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **unassign_instance_private_network** -> UnassignInstancePrivateNetworkResponse unassign_instance_private_network(x_request_id, private_network_id, instance_id) +> UnassignInstancePrivateNetworkResponse unassign_instance_private_network(x_request_id, private_network_id, instance_id, x_trace_id=x_trace_id) Remove instance from a Private Network @@ -589,11 +532,11 @@ Remove a specific instance from a Private Network * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_api -from pfruck_contabo.model.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse +from pfruck_contabo.models.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -607,45 +550,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_api.PrivateNetworksApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.PrivateNetworksApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. private_network_id = 100 # int | The identifier of the Private Network instance_id = 100 # int | The identifier of the instance - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Remove instance from a Private Network - api_response = api_instance.unassign_instance_private_network(x_request_id, private_network_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksApi->unassign_instance_private_network: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Remove instance from a Private Network api_response = api_instance.unassign_instance_private_network(x_request_id, private_network_id, instance_id, x_trace_id=x_trace_id) + print("The response of PrivateNetworksApi->unassign_instance_private_network:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksApi->unassign_instance_private_network: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **private_network_id** | **int**| The identifier of the Private Network | - **instance_id** | **int**| The identifier of the instance | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **private_network_id** | **int**| The identifier of the Private Network | + **instance_id** | **int**| The identifier of the instance | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -660,7 +596,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/PrivateNetworksAuditsApi.md b/docs/PrivateNetworksAuditsApi.md index c39bc7c..274f9dc 100644 --- a/docs/PrivateNetworksAuditsApi.md +++ b/docs/PrivateNetworksAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_private_network_audits_list** -> ListPrivateNetworkAuditResponse retrieve_private_network_audits_list(x_request_id) +> ListPrivateNetworkAuditResponse retrieve_private_network_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, private_network_id=private_network_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your Private Networks (audit) @@ -19,11 +19,11 @@ List and filters the history about your Private Networks. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import private_networks_audits_api -from pfruck_contabo.model.list_private_network_audit_response import ListPrivateNetworkAuditResponse +from pfruck_contabo.models.list_private_network_audit_response import ListPrivateNetworkAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = private_networks_audits_api.PrivateNetworksAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.PrivateNetworksAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) private_network_id = 12345 # int | The identifier of the Private Network (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | User name which did the change. (optional) - start_date = dateutil_parser('2021-01-01').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2023-05-31').date() # date | End of search time range. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | User name which did the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2023-05-31' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your Private Networks (audit) - api_response = api_instance.retrieve_private_network_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling PrivateNetworksAuditsApi->retrieve_private_network_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your Private Networks (audit) api_response = api_instance.retrieve_private_network_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, private_network_id=private_network_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of PrivateNetworksAuditsApi->retrieve_private_network_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling PrivateNetworksAuditsApi->retrieve_private_network_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **private_network_id** | **int**| The identifier of the Private Network | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| User name which did the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **private_network_id** | **int**| The identifier of the Private Network | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| User name which did the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/ReinstallInstanceRequest.md b/docs/ReinstallInstanceRequest.md index 2fdc22b..7dd9356 100644 --- a/docs/ReinstallInstanceRequest.md +++ b/docs/ReinstallInstanceRequest.md @@ -2,16 +2,33 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **image_id** | **str** | ImageId to be used to setup the compute instance. | -**ssh_keys** | **[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | [optional] +**ssh_keys** | **List[int]** | Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API. | [optional] **root_password** | **int** | `secretId` of the password for the `defaultUser` with administrator/root privileges. For Linux/BSD please use SSH, for Windows RDP. Please refer to Secrets Management API. | [optional] **user_data** | **str** | [Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance. | [optional] -**default_user** | **str** | Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`. | [optional] if omitted the server will use the default value of "admin" +**default_user** | **str** | Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`. | [optional] [default to 'admin'] **application_id** | **str** | Application ID | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.reinstall_instance_request import ReinstallInstanceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of ReinstallInstanceRequest from a JSON string +reinstall_instance_request_instance = ReinstallInstanceRequest.from_json(json) +# print the JSON string representation of the object +print(ReinstallInstanceRequest.to_json()) + +# convert the object into a dict +reinstall_instance_request_dict = reinstall_instance_request_instance.to_dict() +# create an instance of ReinstallInstanceRequest from a dict +reinstall_instance_request_from_dict = ReinstallInstanceRequest.from_dict(reinstall_instance_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ReinstallInstanceResponse.md b/docs/ReinstallInstanceResponse.md index d5769df..7f1af27 100644 --- a/docs/ReinstallInstanceResponse.md +++ b/docs/ReinstallInstanceResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[ReinstallInstanceResponseData]**](ReinstallInstanceResponseData.md) | | -**links** | [**PatchInstanceResponseLinks**](PatchInstanceResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[ReinstallInstanceResponseData]**](ReinstallInstanceResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.reinstall_instance_response import ReinstallInstanceResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ReinstallInstanceResponse from a JSON string +reinstall_instance_response_instance = ReinstallInstanceResponse.from_json(json) +# print the JSON string representation of the object +print(ReinstallInstanceResponse.to_json()) +# convert the object into a dict +reinstall_instance_response_dict = reinstall_instance_response_instance.to_dict() +# create an instance of ReinstallInstanceResponse from a dict +reinstall_instance_response_from_dict = ReinstallInstanceResponse.from_dict(reinstall_instance_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ReinstallInstanceResponseData.md b/docs/ReinstallInstanceResponseData.md index c104f59..1f87a6c 100644 --- a/docs/ReinstallInstanceResponseData.md +++ b/docs/ReinstallInstanceResponseData.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **instance_id** | **int** | Instance's id | **created_date** | **datetime** | Creation date for instance | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.reinstall_instance_response_data import ReinstallInstanceResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of ReinstallInstanceResponseData from a JSON string +reinstall_instance_response_data_instance = ReinstallInstanceResponseData.from_json(json) +# print the JSON string representation of the object +print(ReinstallInstanceResponseData.to_json()) + +# convert the object into a dict +reinstall_instance_response_data_dict = reinstall_instance_response_data_instance.to_dict() +# create an instance of ReinstallInstanceResponseData from a dict +reinstall_instance_response_data_from_dict = ReinstallInstanceResponseData.from_dict(reinstall_instance_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ResourcePermissionsResponse.md b/docs/ResourcePermissionsResponse.md index a16e4c4..588ccc9 100644 --- a/docs/ResourcePermissionsResponse.md +++ b/docs/ResourcePermissionsResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tag_id** | **int** | Tag's id | **tag_name** | **str** | Tag name. The resriction is based on the resources which have been assigned to that tag. If no resource has been assigned to the given tag, no access will be possible. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.resource_permissions_response import ResourcePermissionsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ResourcePermissionsResponse from a JSON string +resource_permissions_response_instance = ResourcePermissionsResponse.from_json(json) +# print the JSON string representation of the object +print(ResourcePermissionsResponse.to_json()) + +# convert the object into a dict +resource_permissions_response_dict = resource_permissions_response_instance.to_dict() +# create an instance of ResourcePermissionsResponse from a dict +resource_permissions_response_from_dict = ResourcePermissionsResponse.from_dict(resource_permissions_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RoleAuditResponse.md b/docs/RoleAuditResponse.md index 54cb6ec..9267ed1 100644 --- a/docs/RoleAuditResponse.md +++ b/docs/RoleAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The identifier of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | **role_id** | **float** | The identifier of the role | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.role_audit_response import RoleAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RoleAuditResponse from a JSON string +role_audit_response_instance = RoleAuditResponse.from_json(json) +# print the JSON string representation of the object +print(RoleAuditResponse.to_json()) +# convert the object into a dict +role_audit_response_dict = role_audit_response_instance.to_dict() +# create an instance of RoleAuditResponse from a dict +role_audit_response_from_dict = RoleAuditResponse.from_dict(role_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RoleResponse.md b/docs/RoleResponse.md index ddc9801..16675af 100644 --- a/docs/RoleResponse.md +++ b/docs/RoleResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **role_id** | **int** | Role's id | @@ -11,9 +12,25 @@ Name | Type | Description | Notes **admin** | **bool** | Admin | **access_all_resources** | **bool** | Access All Resources | **type** | **str** | Role type can be either `default` or `custom`. The `default` roles cannot be modified or deleted. | -**permissions** | [**[PermissionResponse]**](PermissionResponse.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**permissions** | [**List[PermissionResponse]**](PermissionResponse.md) | | [optional] + +## Example + +```python +from pfruck_contabo.models.role_response import RoleResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RoleResponse from a JSON string +role_response_instance = RoleResponse.from_json(json) +# print the JSON string representation of the object +print(RoleResponse.to_json()) +# convert the object into a dict +role_response_dict = role_response_instance.to_dict() +# create an instance of RoleResponse from a dict +role_response_from_dict = RoleResponse.from_dict(role_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RolesApi.md b/docs/RolesApi.md index 52bbaac..af8caa8 100644 --- a/docs/RolesApi.md +++ b/docs/RolesApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **create_role** -> CreateRoleResponse create_role(x_request_id, create_role_request) +> CreateRoleResponse create_role(x_request_id, create_role_request, x_trace_id=x_trace_id) Create a new role @@ -24,12 +24,12 @@ Create a new role. In order to get a list availbale api enpoints (apiName) and t * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import roles_api -from pfruck_contabo.model.create_role_response import CreateRoleResponse -from pfruck_contabo.model.create_role_request import CreateRoleRequest +from pfruck_contabo.models.create_role_request import CreateRoleRequest +from pfruck_contabo.models.create_role_response import CreateRoleResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -43,54 +43,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = roles_api.RolesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_role_request = CreateRoleRequest( - name="infrastructure", - admin=False, - access_all_resources=False, - permissions=[ - PermissionRequest( - api_name="infrastructure", - actions=["CREATE","READ"], - resources=[1,2,3], - ), - ], - ) # CreateRoleRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Create a new role - api_response = api_instance.create_role(x_request_id, create_role_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling RolesApi->create_role: %s\n" % e) + api_instance = pfruck_contabo.RolesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_role_request = pfruck_contabo.CreateRoleRequest() # CreateRoleRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new role api_response = api_instance.create_role(x_request_id, create_role_request, x_trace_id=x_trace_id) + print("The response of RolesApi->create_role:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling RolesApi->create_role: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_role_request** | [**CreateRoleRequest**](CreateRoleRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_role_request** | [**CreateRoleRequest**](CreateRoleRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -105,7 +87,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -115,7 +96,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_role** -> delete_role(x_request_id, role_id) +> delete_role(x_request_id, role_id, x_trace_id=x_trace_id) Delete existing role by id @@ -126,10 +107,10 @@ You can't delete a role if it is still assigned to a user. In such cases please * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import roles_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -143,41 +124,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = roles_api.RolesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.RolesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. role_id = 12345 # int | The identifier of the role - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete existing role by id - api_instance.delete_role(x_request_id, role_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling RolesApi->delete_role: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete existing role by id api_instance.delete_role(x_request_id, role_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling RolesApi->delete_role: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **role_id** | **int**| The identifier of the role | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **role_id** | **int**| The identifier of the role | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -192,7 +166,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -202,7 +175,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_api_permissions_list** -> ListApiPermissionResponse retrieve_api_permissions_list(x_request_id) +> ListApiPermissionResponse retrieve_api_permissions_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, api_name=api_name) List of API permissions @@ -213,11 +186,11 @@ List all available API permissions. This list serves as a reference for specifyi * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import roles_api -from pfruck_contabo.model.list_api_permission_response import ListApiPermissionResponse +from pfruck_contabo.models.list_api_permission_response import ListApiPermissionResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -231,51 +204,42 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = roles_api.RolesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.RolesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - api_name = "/v1/compute/instances" # str | The name of api (optional) - - # example passing only required values which don't have defaults set - try: - # List of API permissions - api_response = api_instance.retrieve_api_permissions_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling RolesApi->retrieve_api_permissions_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + api_name = '/v1/compute/instances' # str | The name of api (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List of API permissions api_response = api_instance.retrieve_api_permissions_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, api_name=api_name) + print("The response of RolesApi->retrieve_api_permissions_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling RolesApi->retrieve_api_permissions_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **api_name** | **str**| The name of api | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **api_name** | **str**| The name of api | [optional] ### Return type @@ -290,7 +254,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -300,7 +263,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_role** -> FindRoleResponse retrieve_role(x_request_id, role_id) +> FindRoleResponse retrieve_role(x_request_id, role_id, x_trace_id=x_trace_id) Get specific role by id @@ -311,11 +274,11 @@ Get attributes of specific role. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import roles_api -from pfruck_contabo.model.find_role_response import FindRoleResponse +from pfruck_contabo.models.find_role_response import FindRoleResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -329,43 +292,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = roles_api.RolesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.RolesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. role_id = 12345 # int | The identifier of the role - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get specific role by id - api_response = api_instance.retrieve_role(x_request_id, role_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling RolesApi->retrieve_role: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get specific role by id api_response = api_instance.retrieve_role(x_request_id, role_id, x_trace_id=x_trace_id) + print("The response of RolesApi->retrieve_role:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling RolesApi->retrieve_role: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **role_id** | **int**| The identifier of the role | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **role_id** | **int**| The identifier of the role | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -380,7 +336,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -390,7 +345,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_role_list** -> ListRoleResponse retrieve_role_list(x_request_id) +> ListRoleResponse retrieve_role_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, api_name=api_name, tag_name=tag_name, type=type) List roles @@ -401,11 +356,11 @@ List and filter all your roles. A role allows you to specify permission to api e * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import roles_api -from pfruck_contabo.model.list_role_response import ListRoleResponse +from pfruck_contabo.models.list_role_response import ListRoleResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -419,57 +374,48 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = roles_api.RolesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.RolesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - name = "Web" # str | The name of the role (optional) - api_name = "/v1/compute/instances" # str | The name of api (optional) - tag_name = "Web" # str | The name of the tag (optional) - type = "custom" # str | The type of the tag. Can be either `default` or `custom` (optional) - - # example passing only required values which don't have defaults set - try: - # List roles - api_response = api_instance.retrieve_role_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling RolesApi->retrieve_role_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + name = 'Web' # str | The name of the role (optional) + api_name = '/v1/compute/instances' # str | The name of api (optional) + tag_name = 'Web' # str | The name of the tag (optional) + type = 'custom' # str | The type of the tag. Can be either `default` or `custom` (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List roles api_response = api_instance.retrieve_role_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, api_name=api_name, tag_name=tag_name, type=type) + print("The response of RolesApi->retrieve_role_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling RolesApi->retrieve_role_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **name** | **str**| The name of the role | [optional] - **api_name** | **str**| The name of api | [optional] - **tag_name** | **str**| The name of the tag | [optional] - **type** | **str**| The type of the tag. Can be either `default` or `custom` | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **name** | **str**| The name of the role | [optional] + **api_name** | **str**| The name of api | [optional] + **tag_name** | **str**| The name of the tag | [optional] + **type** | **str**| The type of the tag. Can be either `default` or `custom` | [optional] ### Return type @@ -484,7 +430,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -494,7 +439,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_role** -> UpdateRoleResponse update_role(x_request_id, role_id, update_role_request) +> UpdateRoleResponse update_role(x_request_id, role_id, update_role_request, x_trace_id=x_trace_id) Update specific role by id @@ -505,12 +450,12 @@ Update attributes to your role. Attributes are optional. If not set, the attribu * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import roles_api -from pfruck_contabo.model.update_role_request import UpdateRoleRequest -from pfruck_contabo.model.update_role_response import UpdateRoleResponse +from pfruck_contabo.models.update_role_request import UpdateRoleRequest +from pfruck_contabo.models.update_role_response import UpdateRoleResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -524,56 +469,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = roles_api.RolesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.RolesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. role_id = 12345 # int | The identifier of the role - update_role_request = UpdateRoleRequest( - name="infrastructure", - admin=False, - access_all_resources=False, - permissions=[ - PermissionRequest( - api_name="infrastructure", - actions=["CREATE","READ"], - resources=[1,2,3], - ), - ], - ) # UpdateRoleRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update specific role by id - api_response = api_instance.update_role(x_request_id, role_id, update_role_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling RolesApi->update_role: %s\n" % e) + update_role_request = pfruck_contabo.UpdateRoleRequest() # UpdateRoleRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update specific role by id api_response = api_instance.update_role(x_request_id, role_id, update_role_request, x_trace_id=x_trace_id) + print("The response of RolesApi->update_role:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling RolesApi->update_role: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **role_id** | **int**| The identifier of the role | - **update_role_request** | [**UpdateRoleRequest**](UpdateRoleRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **role_id** | **int**| The identifier of the role | + **update_role_request** | [**UpdateRoleRequest**](UpdateRoleRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -588,7 +515,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/RolesAuditsApi.md b/docs/RolesAuditsApi.md index b243a71..3b428f1 100644 --- a/docs/RolesAuditsApi.md +++ b/docs/RolesAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_role_audits_list** -> ListRoleAuditResponse retrieve_role_audits_list(x_request_id) +> ListRoleAuditResponse retrieve_role_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, role_id=role_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your roles (audit) @@ -19,11 +19,11 @@ List and filter the history about your roles. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import roles_audits_api -from pfruck_contabo.model.list_role_audit_response import ListRoleAuditResponse +from pfruck_contabo.models.list_role_audit_response import ListRoleAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = roles_audits_api.RolesAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.RolesAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) role_id = 12345 # int | The identifier of the role. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | changedBy of the user which led to the change. (optional) - start_date = dateutil_parser('2021-01-01').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-01-01').date() # date | End of search time range. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | changedBy of the user which led to the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2021-01-01' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your roles (audit) - api_response = api_instance.retrieve_role_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling RolesAuditsApi->retrieve_role_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your roles (audit) api_response = api_instance.retrieve_role_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, role_id=role_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of RolesAuditsApi->retrieve_role_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling RolesAuditsApi->retrieve_role_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **role_id** | **int**| The identifier of the role. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| changedBy of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **role_id** | **int**| The identifier of the role. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| changedBy of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/RollbackSnapshotResponse.md b/docs/RollbackSnapshotResponse.md index 9de0735..041363d 100644 --- a/docs/RollbackSnapshotResponse.md +++ b/docs/RollbackSnapshotResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**RollbackSnapshotResponseLinks**](RollbackSnapshotResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.rollback_snapshot_response import RollbackSnapshotResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of RollbackSnapshotResponse from a JSON string +rollback_snapshot_response_instance = RollbackSnapshotResponse.from_json(json) +# print the JSON string representation of the object +print(RollbackSnapshotResponse.to_json()) +# convert the object into a dict +rollback_snapshot_response_dict = rollback_snapshot_response_instance.to_dict() +# create an instance of RollbackSnapshotResponse from a dict +rollback_snapshot_response_from_dict = RollbackSnapshotResponse.from_dict(rollback_snapshot_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SecretAuditResponse.md b/docs/SecretAuditResponse.md index 04db52f..0103821 100644 --- a/docs/SecretAuditResponse.md +++ b/docs/SecretAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **float** | The identifier of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **username** | **str** | Name of the user which led to the change. | **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.secret_audit_response import SecretAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SecretAuditResponse from a JSON string +secret_audit_response_instance = SecretAuditResponse.from_json(json) +# print the JSON string representation of the object +print(SecretAuditResponse.to_json()) +# convert the object into a dict +secret_audit_response_dict = secret_audit_response_instance.to_dict() +# create an instance of SecretAuditResponse from a dict +secret_audit_response_from_dict = SecretAuditResponse.from_dict(secret_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SecretResponse.md b/docs/SecretResponse.md index 4bf2612..a0d0c5f 100644 --- a/docs/SecretResponse.md +++ b/docs/SecretResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -12,8 +13,24 @@ Name | Type | Description | Notes **value** | **str** | The value of the secret. This will be available only when retrieving a single secret | **created_at** | **datetime** | The creation date for the secret | **updated_at** | **datetime** | The last update date for the secret | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.secret_response import SecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SecretResponse from a JSON string +secret_response_instance = SecretResponse.from_json(json) +# print the JSON string representation of the object +print(SecretResponse.to_json()) + +# convert the object into a dict +secret_response_dict = secret_response_instance.to_dict() +# create an instance of SecretResponse from a dict +secret_response_from_dict = SecretResponse.from_dict(secret_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SecretsApi.md b/docs/SecretsApi.md index cb1460d..41ca6ab 100644 --- a/docs/SecretsApi.md +++ b/docs/SecretsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **create_secret** -> CreateSecretResponse create_secret(x_request_id, create_secret_request) +> CreateSecretResponse create_secret(x_request_id, create_secret_request, x_trace_id=x_trace_id) Create a new secret @@ -23,12 +23,12 @@ Create a new secret in your account with attributes name, type and value. Attrib * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import secrets_api -from pfruck_contabo.model.create_secret_response import CreateSecretResponse -from pfruck_contabo.model.create_secret_request import CreateSecretRequest +from pfruck_contabo.models.create_secret_request import CreateSecretRequest +from pfruck_contabo.models.create_secret_response import CreateSecretResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -42,47 +42,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = secrets_api.SecretsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_secret_request = CreateSecretRequest( - name="my-password", - value="PwdA?2092w#", - type="password", - ) # CreateSecretRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Create a new secret - api_response = api_instance.create_secret(x_request_id, create_secret_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SecretsApi->create_secret: %s\n" % e) + api_instance = pfruck_contabo.SecretsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_secret_request = pfruck_contabo.CreateSecretRequest() # CreateSecretRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new secret api_response = api_instance.create_secret(x_request_id, create_secret_request, x_trace_id=x_trace_id) + print("The response of SecretsApi->create_secret:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SecretsApi->create_secret: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_secret_request** | [**CreateSecretRequest**](CreateSecretRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_secret_request** | [**CreateSecretRequest**](CreateSecretRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -97,7 +86,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -107,7 +95,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_secret** -> delete_secret(x_request_id, secret_id) +> delete_secret(x_request_id, secret_id, x_trace_id=x_trace_id) Delete existing secret by id @@ -118,10 +106,10 @@ You can remove a specific secret from your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import secrets_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -135,41 +123,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = secrets_api.SecretsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SecretsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. secret_id = 123 # int | The id of the secret - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete existing secret by id - api_instance.delete_secret(x_request_id, secret_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling SecretsApi->delete_secret: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete existing secret by id api_instance.delete_secret(x_request_id, secret_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SecretsApi->delete_secret: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **secret_id** | **int**| The id of the secret | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **secret_id** | **int**| The id of the secret | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -184,7 +165,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -194,7 +174,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_secret** -> FindSecretResponse retrieve_secret(x_request_id, secret_id) +> FindSecretResponse retrieve_secret(x_request_id, secret_id, x_trace_id=x_trace_id) Get specific secret by id @@ -205,11 +185,11 @@ Get attributes values for a specific secret on your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import secrets_api -from pfruck_contabo.model.find_secret_response import FindSecretResponse +from pfruck_contabo.models.find_secret_response import FindSecretResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -223,43 +203,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = secrets_api.SecretsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SecretsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. secret_id = 123 # int | The id of the secret - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Get specific secret by id - api_response = api_instance.retrieve_secret(x_request_id, secret_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SecretsApi->retrieve_secret: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get specific secret by id api_response = api_instance.retrieve_secret(x_request_id, secret_id, x_trace_id=x_trace_id) + print("The response of SecretsApi->retrieve_secret:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SecretsApi->retrieve_secret: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **secret_id** | **int**| The id of the secret | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **secret_id** | **int**| The id of the secret | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -274,7 +247,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -284,7 +256,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_secret_list** -> ListSecretResponse retrieve_secret_list(x_request_id) +> ListSecretResponse retrieve_secret_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, type=type) List secrets @@ -295,11 +267,11 @@ List and filter all secrets in your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import secrets_api -from pfruck_contabo.model.list_secret_response import ListSecretResponse +from pfruck_contabo.models.list_secret_response import ListSecretResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -313,53 +285,44 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = secrets_api.SecretsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.SecretsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - name = "mysecret" # str | Filter secrets by name (optional) - type = "password" # str | Filter secrets by type (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + name = 'mysecret' # str | Filter secrets by name (optional) + type = 'type_example' # str | Filter secrets by type (optional) - # example passing only required values which don't have defaults set - try: - # List secrets - api_response = api_instance.retrieve_secret_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SecretsApi->retrieve_secret_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List secrets api_response = api_instance.retrieve_secret_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, type=type) + print("The response of SecretsApi->retrieve_secret_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SecretsApi->retrieve_secret_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **name** | **str**| Filter secrets by name | [optional] - **type** | **str**| Filter secrets by type | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **name** | **str**| Filter secrets by name | [optional] + **type** | **str**| Filter secrets by type | [optional] ### Return type @@ -374,7 +337,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -384,7 +346,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_secret** -> UpdateSecretResponse update_secret(x_request_id, secret_id, update_secret_request) +> UpdateSecretResponse update_secret(x_request_id, secret_id, update_secret_request, x_trace_id=x_trace_id) Update specific secret by id @@ -395,12 +357,12 @@ Update attributes to your secret. Attributes are optional. If not set, the attri * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import secrets_api -from pfruck_contabo.model.update_secret_response import UpdateSecretResponse -from pfruck_contabo.model.update_secret_request import UpdateSecretRequest +from pfruck_contabo.models.update_secret_request import UpdateSecretRequest +from pfruck_contabo.models.update_secret_response import UpdateSecretResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -414,48 +376,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = secrets_api.SecretsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SecretsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. secret_id = 123 # int | The id of the secret - update_secret_request = UpdateSecretRequest( - name="name_example", - value="value_example", - ) # UpdateSecretRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update specific secret by id - api_response = api_instance.update_secret(x_request_id, secret_id, update_secret_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SecretsApi->update_secret: %s\n" % e) + update_secret_request = pfruck_contabo.UpdateSecretRequest() # UpdateSecretRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update specific secret by id api_response = api_instance.update_secret(x_request_id, secret_id, update_secret_request, x_trace_id=x_trace_id) + print("The response of SecretsApi->update_secret:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SecretsApi->update_secret: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **secret_id** | **int**| The id of the secret | - **update_secret_request** | [**UpdateSecretRequest**](UpdateSecretRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **secret_id** | **int**| The id of the secret | + **update_secret_request** | [**UpdateSecretRequest**](UpdateSecretRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -470,7 +422,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/SecretsAuditsApi.md b/docs/SecretsAuditsApi.md index f8a3d30..cfaad97 100644 --- a/docs/SecretsAuditsApi.md +++ b/docs/SecretsAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_secret_audits_list** -> ListSecretAuditResponse retrieve_secret_audits_list(x_request_id) +> ListSecretAuditResponse retrieve_secret_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, secret_id=secret_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your secrets (audit) @@ -19,11 +19,11 @@ List and filters the history about your secrets. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import secrets_audits_api -from pfruck_contabo.model.list_secret_audit_response import ListSecretAuditResponse +from pfruck_contabo.models.list_secret_audit_response import ListSecretAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = secrets_audits_api.SecretsAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.SecretsAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) secret_id = 123 # int | The id of the secret. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | changedBy of the user which led to the change. (optional) - start_date = dateutil_parser('2021-01-01').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-01-01').date() # date | End of search time range. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | changedBy of the user which led to the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2021-01-01' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your secrets (audit) - api_response = api_instance.retrieve_secret_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SecretsAuditsApi->retrieve_secret_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your secrets (audit) api_response = api_instance.retrieve_secret_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, secret_id=secret_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of SecretsAuditsApi->retrieve_secret_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SecretsAuditsApi->retrieve_secret_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **secret_id** | **int**| The id of the secret. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| changedBy of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **secret_id** | **int**| The id of the secret. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| changedBy of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/SelfLinks.md b/docs/SelfLinks.md index f468714..4796b4b 100644 --- a/docs/SelfLinks.md +++ b/docs/SelfLinks.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_self** | **str** | Link to current resource. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**var_self** | **str** | Link to current resource. | + +## Example + +```python +from pfruck_contabo.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print(SelfLinks.to_json()) +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_from_dict = SelfLinks.from_dict(self_links_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SnapshotResponse.md b/docs/SnapshotResponse.md index ea96f0b..8cf82d8 100644 --- a/docs/SnapshotResponse.md +++ b/docs/SnapshotResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -14,8 +15,24 @@ Name | Type | Description | Notes **auto_delete_date** | **datetime** | The date when the snapshot will be auto-deleted | **image_id** | **str** | Image Id the snapshot was taken on | **image_name** | **str** | Image name the snapshot was taken on | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.snapshot_response import SnapshotResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SnapshotResponse from a JSON string +snapshot_response_instance = SnapshotResponse.from_json(json) +# print the JSON string representation of the object +print(SnapshotResponse.to_json()) + +# convert the object into a dict +snapshot_response_dict = snapshot_response_instance.to_dict() +# create an instance of SnapshotResponse from a dict +snapshot_response_from_dict = SnapshotResponse.from_dict(snapshot_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SnapshotsApi.md b/docs/SnapshotsApi.md index dd35ac2..52602b3 100644 --- a/docs/SnapshotsApi.md +++ b/docs/SnapshotsApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description # **create_snapshot** -> CreateSnapshotResponse create_snapshot(x_request_id, instance_id, create_snapshot_request) +> CreateSnapshotResponse create_snapshot(x_request_id, instance_id, create_snapshot_request, x_trace_id=x_trace_id) Create a new instance snapshot @@ -24,12 +24,12 @@ Create a new snapshot for instance, with name and description attributes * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import snapshots_api -from pfruck_contabo.model.create_snapshot_response import CreateSnapshotResponse -from pfruck_contabo.model.create_snapshot_request import CreateSnapshotRequest +from pfruck_contabo.models.create_snapshot_request import CreateSnapshotRequest +from pfruck_contabo.models.create_snapshot_response import CreateSnapshotResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -43,48 +43,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = snapshots_api.SnapshotsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SnapshotsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - create_snapshot_request = CreateSnapshotRequest( - name="Snapshot-Server", - description="Snapshot-Description", - ) # CreateSnapshotRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + create_snapshot_request = pfruck_contabo.CreateSnapshotRequest() # CreateSnapshotRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Create a new instance snapshot - api_response = api_instance.create_snapshot(x_request_id, instance_id, create_snapshot_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SnapshotsApi->create_snapshot: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Create a new instance snapshot api_response = api_instance.create_snapshot(x_request_id, instance_id, create_snapshot_request, x_trace_id=x_trace_id) + print("The response of SnapshotsApi->create_snapshot:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SnapshotsApi->create_snapshot: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **create_snapshot_request** | [**CreateSnapshotRequest**](CreateSnapshotRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **create_snapshot_request** | [**CreateSnapshotRequest**](CreateSnapshotRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -99,7 +89,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -109,7 +98,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_snapshot** -> delete_snapshot(x_request_id, instance_id, snapshot_id) +> delete_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id) Delete existing snapshot by id @@ -120,10 +109,10 @@ Delete existing instance snapshot by id * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import snapshots_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -137,43 +126,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = snapshots_api.SnapshotsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SnapshotsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - snapshot_id = "snap1628603855" # str | The identifier of the snapshot - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete existing snapshot by id - api_instance.delete_snapshot(x_request_id, instance_id, snapshot_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling SnapshotsApi->delete_snapshot: %s\n" % e) + snapshot_id = 'snap1628603855' # str | The identifier of the snapshot + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete existing snapshot by id api_instance.delete_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SnapshotsApi->delete_snapshot: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **snapshot_id** | **str**| The identifier of the snapshot | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **snapshot_id** | **str**| The identifier of the snapshot | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -188,7 +170,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -198,7 +179,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_snapshot** -> FindSnapshotResponse retrieve_snapshot(x_request_id, instance_id, snapshot_id) +> FindSnapshotResponse retrieve_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id) Retrieve a specific snapshot by id @@ -209,11 +190,11 @@ Get all attributes for a specific snapshot * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import snapshots_api -from pfruck_contabo.model.find_snapshot_response import FindSnapshotResponse +from pfruck_contabo.models.find_snapshot_response import FindSnapshotResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -227,45 +208,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = snapshots_api.SnapshotsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SnapshotsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - snapshot_id = "snap1628603855" # str | The identifier of the snapshot - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + snapshot_id = 'snap1628603855' # str | The identifier of the snapshot + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Retrieve a specific snapshot by id - api_response = api_instance.retrieve_snapshot(x_request_id, instance_id, snapshot_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SnapshotsApi->retrieve_snapshot: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Retrieve a specific snapshot by id api_response = api_instance.retrieve_snapshot(x_request_id, instance_id, snapshot_id, x_trace_id=x_trace_id) + print("The response of SnapshotsApi->retrieve_snapshot:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SnapshotsApi->retrieve_snapshot: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **snapshot_id** | **str**| The identifier of the snapshot | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **snapshot_id** | **str**| The identifier of the snapshot | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -280,7 +254,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -290,7 +263,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_snapshot_list** -> ListSnapshotResponse retrieve_snapshot_list(x_request_id, instance_id) +> ListSnapshotResponse retrieve_snapshot_list(x_request_id, instance_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name) List snapshots @@ -301,11 +274,11 @@ List and filter all your snapshots for a specific instance * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import snapshots_api -from pfruck_contabo.model.list_snapshot_response import ListSnapshotResponse +from pfruck_contabo.models.list_snapshot_response import ListSnapshotResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -319,53 +292,44 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = snapshots_api.SnapshotsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SnapshotsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - name = "Snapshot.Server" # str | Filter as substring match for snapshots names. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + name = 'Snapshot.Server' # str | Filter as substring match for snapshots names. (optional) - # example passing only required values which don't have defaults set - try: - # List snapshots - api_response = api_instance.retrieve_snapshot_list(x_request_id, instance_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SnapshotsApi->retrieve_snapshot_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List snapshots api_response = api_instance.retrieve_snapshot_list(x_request_id, instance_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name) + print("The response of SnapshotsApi->retrieve_snapshot_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SnapshotsApi->retrieve_snapshot_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **name** | **str**| Filter as substring match for snapshots names. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **name** | **str**| Filter as substring match for snapshots names. | [optional] ### Return type @@ -380,7 +344,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -390,7 +353,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **rollback_snapshot** -> RollbackSnapshotResponse rollback_snapshot(x_request_id, instance_id, snapshot_id, body) +> RollbackSnapshotResponse rollback_snapshot(x_request_id, instance_id, snapshot_id, body, x_trace_id=x_trace_id) Revert the instance to a particular snapshot based on its identifier @@ -401,11 +364,11 @@ Rollback instance to a specific snapshot. The snapshot must be the latest one in * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import snapshots_api -from pfruck_contabo.model.rollback_snapshot_response import RollbackSnapshotResponse +from pfruck_contabo.models.rollback_snapshot_response import RollbackSnapshotResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -419,47 +382,40 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = snapshots_api.SnapshotsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SnapshotsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - snapshot_id = "snap1628603855" # str | The identifier of the snapshot - body = {} # {str: (bool, date, datetime, dict, float, int, list, str, none_type)} | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Revert the instance to a particular snapshot based on its identifier - api_response = api_instance.rollback_snapshot(x_request_id, instance_id, snapshot_id, body) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SnapshotsApi->rollback_snapshot: %s\n" % e) + snapshot_id = 'snap1628603855' # str | The identifier of the snapshot + body = None # object | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Revert the instance to a particular snapshot based on its identifier api_response = api_instance.rollback_snapshot(x_request_id, instance_id, snapshot_id, body, x_trace_id=x_trace_id) + print("The response of SnapshotsApi->rollback_snapshot:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SnapshotsApi->rollback_snapshot: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **snapshot_id** | **str**| The identifier of the snapshot | - **body** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **snapshot_id** | **str**| The identifier of the snapshot | + **body** | **object**| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -474,7 +430,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -484,7 +439,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_snapshot** -> UpdateSnapshotResponse update_snapshot(x_request_id, instance_id, snapshot_id, update_snapshot_request) +> UpdateSnapshotResponse update_snapshot(x_request_id, instance_id, snapshot_id, update_snapshot_request, x_trace_id=x_trace_id) Update specific snapshot by id @@ -495,12 +450,12 @@ Update attributes of a snapshot. You may only specify the attributes you want to * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import snapshots_api -from pfruck_contabo.model.update_snapshot_response import UpdateSnapshotResponse -from pfruck_contabo.model.update_snapshot_request import UpdateSnapshotRequest +from pfruck_contabo.models.update_snapshot_request import UpdateSnapshotRequest +from pfruck_contabo.models.update_snapshot_response import UpdateSnapshotResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -514,50 +469,40 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = snapshots_api.SnapshotsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.SnapshotsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. instance_id = 12345 # int | The identifier of the instance - snapshot_id = "snap1628603855" # str | The identifier of the snapshot - update_snapshot_request = UpdateSnapshotRequest( - name="Snapshot-Server", - description="Snapshot-Description", - ) # UpdateSnapshotRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update specific snapshot by id - api_response = api_instance.update_snapshot(x_request_id, instance_id, snapshot_id, update_snapshot_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SnapshotsApi->update_snapshot: %s\n" % e) + snapshot_id = 'snap1628603855' # str | The identifier of the snapshot + update_snapshot_request = pfruck_contabo.UpdateSnapshotRequest() # UpdateSnapshotRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update specific snapshot by id api_response = api_instance.update_snapshot(x_request_id, instance_id, snapshot_id, update_snapshot_request, x_trace_id=x_trace_id) + print("The response of SnapshotsApi->update_snapshot:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SnapshotsApi->update_snapshot: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **instance_id** | **int**| The identifier of the instance | - **snapshot_id** | **str**| The identifier of the snapshot | - **update_snapshot_request** | [**UpdateSnapshotRequest**](UpdateSnapshotRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **snapshot_id** | **str**| The identifier of the snapshot | + **update_snapshot_request** | [**UpdateSnapshotRequest**](UpdateSnapshotRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -572,7 +517,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/SnapshotsAuditResponse.md b/docs/SnapshotsAuditResponse.md index 87cccaf..2709dd2 100644 --- a/docs/SnapshotsAuditResponse.md +++ b/docs/SnapshotsAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The ID of the audit entry. | @@ -15,9 +16,25 @@ Name | Type | Description | Notes **trace_id** | **str** | The traceId of the API call which led to the change. | **instance_id** | **int** | The identifier of the instance | **snapshot_id** | **str** | The identifier of the snapshot | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes | [optional] + +## Example + +```python +from pfruck_contabo.models.snapshots_audit_response import SnapshotsAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SnapshotsAuditResponse from a JSON string +snapshots_audit_response_instance = SnapshotsAuditResponse.from_json(json) +# print the JSON string representation of the object +print(SnapshotsAuditResponse.to_json()) +# convert the object into a dict +snapshots_audit_response_dict = snapshots_audit_response_instance.to_dict() +# create an instance of SnapshotsAuditResponse from a dict +snapshots_audit_response_from_dict = SnapshotsAuditResponse.from_dict(snapshots_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SnapshotsAuditsApi.md b/docs/SnapshotsAuditsApi.md index 7daa10e..3a04a3f 100644 --- a/docs/SnapshotsAuditsApi.md +++ b/docs/SnapshotsAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_snapshots_audits_list** -> ListSnapshotsAuditResponse retrieve_snapshots_audits_list(x_request_id) +> ListSnapshotsAuditResponse retrieve_snapshots_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, instance_id=instance_id, snapshot_id=snapshot_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your snapshots (audit) triggered via the API @@ -19,11 +19,11 @@ List and filters the history about your snapshots your triggered via the API. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import snapshots_audits_api -from pfruck_contabo.model.list_snapshots_audit_response import ListSnapshotsAuditResponse +from pfruck_contabo.models.list_snapshots_audit_response import ListSnapshotsAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,61 +37,52 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = snapshots_audits_api.SnapshotsAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.SnapshotsAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) instance_id = 12345 # int | The identifier of the instance (optional) - snapshot_id = "snap1628603855" # str | The identifier of the snapshot (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | changedBy of the user which led to the change (optional) - start_date = dateutil_parser('2021-06-02').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-06-02').date() # date | End of search time range. (optional) + snapshot_id = 'snap1628603855' # str | The identifier of the snapshot (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | changedBy of the user which led to the change (optional) + start_date = '2021-06-02' # date | Start of search time range. (optional) + end_date = '2021-06-02' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your snapshots (audit) triggered via the API - api_response = api_instance.retrieve_snapshots_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling SnapshotsAuditsApi->retrieve_snapshots_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your snapshots (audit) triggered via the API api_response = api_instance.retrieve_snapshots_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, instance_id=instance_id, snapshot_id=snapshot_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of SnapshotsAuditsApi->retrieve_snapshots_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling SnapshotsAuditsApi->retrieve_snapshots_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **instance_id** | **int**| The identifier of the instance | [optional] - **snapshot_id** | **str**| The identifier of the snapshot | [optional] - **request_id** | **str**| The requestId of the API call which led to the change | [optional] - **changed_by** | **str**| changedBy of the user which led to the change | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **instance_id** | **int**| The identifier of the instance | [optional] + **snapshot_id** | **str**| The identifier of the snapshot | [optional] + **request_id** | **str**| The requestId of the API call which led to the change | [optional] + **changed_by** | **str**| changedBy of the user which led to the change | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -106,7 +97,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/TagAssignmentSelfLinks.md b/docs/TagAssignmentSelfLinks.md index bd952f0..e6ff589 100644 --- a/docs/TagAssignmentSelfLinks.md +++ b/docs/TagAssignmentSelfLinks.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_self** | **str** | Link to current resource. | +**var_self** | **str** | Link to current resource. | **tag** | **str** | Link to related tag. | **resource** | **str** | Link to assigned resource | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.tag_assignment_self_links import TagAssignmentSelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of TagAssignmentSelfLinks from a JSON string +tag_assignment_self_links_instance = TagAssignmentSelfLinks.from_json(json) +# print the JSON string representation of the object +print(TagAssignmentSelfLinks.to_json()) + +# convert the object into a dict +tag_assignment_self_links_dict = tag_assignment_self_links_instance.to_dict() +# create an instance of TagAssignmentSelfLinks from a dict +tag_assignment_self_links_from_dict = TagAssignmentSelfLinks.from_dict(tag_assignment_self_links_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TagAssignmentsApi.md b/docs/TagAssignmentsApi.md index 4dfb21b..875a0be 100644 --- a/docs/TagAssignmentsApi.md +++ b/docs/TagAssignmentsApi.md @@ -11,7 +11,7 @@ Method | HTTP request | Description # **create_assignment** -> CreateAssignmentResponse create_assignment(x_request_id, tag_id, resource_type, resource_id) +> CreateAssignmentResponse create_assignment(x_request_id, tag_id, resource_type, resource_id, x_trace_id=x_trace_id) Create a new assignment for the tag @@ -22,11 +22,11 @@ Create a new tag assignment. This marks the specified resource with the specifie * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tag_assignments_api -from pfruck_contabo.model.create_assignment_response import CreateAssignmentResponse +from pfruck_contabo.models.create_assignment_response import CreateAssignmentResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -40,47 +40,40 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tag_assignments_api.TagAssignmentsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.TagAssignmentsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. tag_id = 12345 # int | The identifier of the tag. - resource_type = "instance" # str | The identifier of the resource type. Resource type is one of `instance|image|object-storage`. - resource_id = "d65ecf3b-30db-4dc2-9e88-dfc21a14a6bc" # str | The identifier of the resource id - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + resource_type = 'instance' # str | The identifier of the resource type. Resource type is one of `instance|image|object-storage`. + resource_id = 'd65ecf3b-30db-4dc2-9e88-dfc21a14a6bc' # str | The identifier of the resource id + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Create a new assignment for the tag - api_response = api_instance.create_assignment(x_request_id, tag_id, resource_type, resource_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagAssignmentsApi->create_assignment: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Create a new assignment for the tag api_response = api_instance.create_assignment(x_request_id, tag_id, resource_type, resource_id, x_trace_id=x_trace_id) + print("The response of TagAssignmentsApi->create_assignment:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagAssignmentsApi->create_assignment: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **tag_id** | **int**| The identifier of the tag. | - **resource_type** | **str**| The identifier of the resource type. Resource type is one of `instance|image|object-storage`. | - **resource_id** | **str**| The identifier of the resource id | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **tag_id** | **int**| The identifier of the tag. | + **resource_type** | **str**| The identifier of the resource type. Resource type is one of `instance|image|object-storage`. | + **resource_id** | **str**| The identifier of the resource id | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -95,7 +88,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -105,7 +97,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_assignment** -> delete_assignment(x_request_id, tag_id, resource_type, resource_id) +> delete_assignment(x_request_id, tag_id, resource_type, resource_id, x_trace_id=x_trace_id) Delete existing tag assignment @@ -116,10 +108,10 @@ Tag assignment will be removed from the specified resource. If this tag is being * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tag_assignments_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -133,45 +125,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tag_assignments_api.TagAssignmentsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.TagAssignmentsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. tag_id = 12345 # int | The identifier of the tag. - resource_type = "instance" # str | The identifier of the resource type. Resource type is one of `instance|image|object-storage`. - resource_id = "d65ecf3b-30db-4dc2-9e88-dfc21a14a6bc" # str | The identifier of the resource id - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete existing tag assignment - api_instance.delete_assignment(x_request_id, tag_id, resource_type, resource_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagAssignmentsApi->delete_assignment: %s\n" % e) + resource_type = 'instance' # str | The identifier of the resource type. Resource type is one of `instance|image|object-storage`. + resource_id = 'd65ecf3b-30db-4dc2-9e88-dfc21a14a6bc' # str | The identifier of the resource id + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete existing tag assignment api_instance.delete_assignment(x_request_id, tag_id, resource_type, resource_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagAssignmentsApi->delete_assignment: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **tag_id** | **int**| The identifier of the tag. | - **resource_type** | **str**| The identifier of the resource type. Resource type is one of `instance|image|object-storage`. | - **resource_id** | **str**| The identifier of the resource id | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **tag_id** | **int**| The identifier of the tag. | + **resource_type** | **str**| The identifier of the resource type. Resource type is one of `instance|image|object-storage`. | + **resource_id** | **str**| The identifier of the resource id | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -186,7 +171,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -196,7 +180,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_assignment** -> FindAssignmentResponse retrieve_assignment(x_request_id, tag_id, resource_type, resource_id) +> FindAssignmentResponse retrieve_assignment(x_request_id, tag_id, resource_type, resource_id, x_trace_id=x_trace_id) Get specific assignment for the tag @@ -207,11 +191,11 @@ Get attributes for a specific tag assignment in your account. For this the resou * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tag_assignments_api -from pfruck_contabo.model.find_assignment_response import FindAssignmentResponse +from pfruck_contabo.models.find_assignment_response import FindAssignmentResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -225,47 +209,40 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tag_assignments_api.TagAssignmentsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.TagAssignmentsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. tag_id = 12345 # int | The identifier of the tag. - resource_type = "instance" # str | The identifier of the resource type. Resource type is one of `instance|image|object-storage`. - resource_id = "d65ecf3b-30db-4dc2-9e88-dfc21a14a6bc" # str | The identifier of the resource id - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + resource_type = 'instance' # str | The identifier of the resource type. Resource type is one of `instance|image|object-storage`. + resource_id = 'd65ecf3b-30db-4dc2-9e88-dfc21a14a6bc' # str | The identifier of the resource id + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get specific assignment for the tag - api_response = api_instance.retrieve_assignment(x_request_id, tag_id, resource_type, resource_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagAssignmentsApi->retrieve_assignment: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get specific assignment for the tag api_response = api_instance.retrieve_assignment(x_request_id, tag_id, resource_type, resource_id, x_trace_id=x_trace_id) + print("The response of TagAssignmentsApi->retrieve_assignment:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagAssignmentsApi->retrieve_assignment: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **tag_id** | **int**| The identifier of the tag. | - **resource_type** | **str**| The identifier of the resource type. Resource type is one of `instance|image|object-storage`. | - **resource_id** | **str**| The identifier of the resource id | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **tag_id** | **int**| The identifier of the tag. | + **resource_type** | **str**| The identifier of the resource type. Resource type is one of `instance|image|object-storage`. | + **resource_id** | **str**| The identifier of the resource id | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -280,7 +257,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -290,7 +266,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_assignment_list** -> ListAssignmentResponse retrieve_assignment_list(x_request_id, tag_id) +> ListAssignmentResponse retrieve_assignment_list(x_request_id, tag_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, resource_type=resource_type) List tag assignments @@ -301,11 +277,11 @@ List and filter all existing assignments for a tag in your account * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tag_assignments_api -from pfruck_contabo.model.list_assignment_response import ListAssignmentResponse +from pfruck_contabo.models.list_assignment_response import ListAssignmentResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -319,53 +295,44 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tag_assignments_api.TagAssignmentsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.TagAssignmentsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. tag_id = 12345 # int | The identifier of the tag. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - resource_type = "instance" # str | Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + resource_type = 'instance' # str | Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`. (optional) - # example passing only required values which don't have defaults set - try: - # List tag assignments - api_response = api_instance.retrieve_assignment_list(x_request_id, tag_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagAssignmentsApi->retrieve_assignment_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List tag assignments api_response = api_instance.retrieve_assignment_list(x_request_id, tag_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, resource_type=resource_type) + print("The response of TagAssignmentsApi->retrieve_assignment_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagAssignmentsApi->retrieve_assignment_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **tag_id** | **int**| The identifier of the tag. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **resource_type** | **str**| Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **tag_id** | **int**| The identifier of the tag. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **resource_type** | **str**| Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`. | [optional] ### Return type @@ -380,7 +347,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/TagAssignmentsAuditsApi.md b/docs/TagAssignmentsAuditsApi.md index ffc1794..3985925 100644 --- a/docs/TagAssignmentsAuditsApi.md +++ b/docs/TagAssignmentsAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_assignments_audits_list** -> ListAssignmentAuditsResponse retrieve_assignments_audits_list(x_request_id) +> ListAssignmentAuditsResponse retrieve_assignments_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, tag_id=tag_id, resource_id=resource_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your assignments (audit) @@ -19,11 +19,11 @@ List and filters the history about your assignments. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tag_assignments_audits_api -from pfruck_contabo.model.list_assignment_audits_response import ListAssignmentAuditsResponse +from pfruck_contabo.models.list_assignment_audits_response import ListAssignmentAuditsResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,61 +37,52 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tag_assignments_audits_api.TagAssignmentsAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.TagAssignmentsAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) tag_id = 12345 # int | The identifier of the tag. (optional) - resource_id = "a1b2c3" # str | The identifier of the resource. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | UserId of the user which led to the change. (optional) - start_date = dateutil_parser('2021-01-01').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-01-01').date() # date | End of search time range. (optional) + resource_id = 'a1b2c3' # str | The identifier of the resource. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | UserId of the user which led to the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2021-01-01' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your assignments (audit) - api_response = api_instance.retrieve_assignments_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagAssignmentsAuditsApi->retrieve_assignments_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your assignments (audit) api_response = api_instance.retrieve_assignments_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, tag_id=tag_id, resource_id=resource_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of TagAssignmentsAuditsApi->retrieve_assignments_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagAssignmentsAuditsApi->retrieve_assignments_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **tag_id** | **int**| The identifier of the tag. | [optional] - **resource_id** | **str**| The identifier of the resource. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| UserId of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **tag_id** | **int**| The identifier of the tag. | [optional] + **resource_id** | **str**| The identifier of the resource. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| UserId of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -106,7 +97,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/TagAuditResponse.md b/docs/TagAuditResponse.md index 6da684d..c51d26b 100644 --- a/docs/TagAuditResponse.md +++ b/docs/TagAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **username** | **str** | Name of the user which led to the change. | **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.tag_audit_response import TagAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of TagAuditResponse from a JSON string +tag_audit_response_instance = TagAuditResponse.from_json(json) +# print the JSON string representation of the object +print(TagAuditResponse.to_json()) +# convert the object into a dict +tag_audit_response_dict = tag_audit_response_instance.to_dict() +# create an instance of TagAuditResponse from a dict +tag_audit_response_from_dict = TagAuditResponse.from_dict(tag_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TagResponse.md b/docs/TagResponse.md index 9670d29..ae35e6e 100644 --- a/docs/TagResponse.md +++ b/docs/TagResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -9,8 +10,24 @@ Name | Type | Description | Notes **tag_id** | **int** | Tag's id | **name** | **str** | Tag's name | **color** | **str** | Tag's color | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.tag_response import TagResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of TagResponse from a JSON string +tag_response_instance = TagResponse.from_json(json) +# print the JSON string representation of the object +print(TagResponse.to_json()) + +# convert the object into a dict +tag_response_dict = tag_response_instance.to_dict() +# create an instance of TagResponse from a dict +tag_response_from_dict = TagResponse.from_dict(tag_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TagsApi.md b/docs/TagsApi.md index 7f45a03..d330f1a 100644 --- a/docs/TagsApi.md +++ b/docs/TagsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **create_tag** -> CreateTagResponse create_tag(x_request_id, create_tag_request) +> CreateTagResponse create_tag(x_request_id, create_tag_request, x_trace_id=x_trace_id) Create a new tag @@ -23,12 +23,12 @@ Create a new tag in your account with attribute name and optional attribute colo * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tags_api -from pfruck_contabo.model.create_tag_response import CreateTagResponse -from pfruck_contabo.model.create_tag_request import CreateTagRequest +from pfruck_contabo.models.create_tag_request import CreateTagRequest +from pfruck_contabo.models.create_tag_response import CreateTagResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -42,46 +42,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tags_api.TagsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_tag_request = CreateTagRequest( - name="Web-Server", - color="#0A78C3", - ) # CreateTagRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Create a new tag - api_response = api_instance.create_tag(x_request_id, create_tag_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagsApi->create_tag: %s\n" % e) + api_instance = pfruck_contabo.TagsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_tag_request = pfruck_contabo.CreateTagRequest() # CreateTagRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new tag api_response = api_instance.create_tag(x_request_id, create_tag_request, x_trace_id=x_trace_id) + print("The response of TagsApi->create_tag:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagsApi->create_tag: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_tag_request** | [**CreateTagRequest**](CreateTagRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_tag_request** | [**CreateTagRequest**](CreateTagRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -96,7 +86,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -106,7 +95,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_tag** -> delete_tag(x_request_id, tag_id) +> delete_tag(x_request_id, tag_id, x_trace_id=x_trace_id) Delete existing tag by id @@ -117,10 +106,10 @@ Your tag can be deleted if it is not assigned to any resource on your account. C * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tags_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -134,41 +123,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tags_api.TagsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.TagsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. tag_id = 12345 # int | The identifier of the tag - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete existing tag by id - api_instance.delete_tag(x_request_id, tag_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagsApi->delete_tag: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete existing tag by id api_instance.delete_tag(x_request_id, tag_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagsApi->delete_tag: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **tag_id** | **int**| The identifier of the tag | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **tag_id** | **int**| The identifier of the tag | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -183,7 +165,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -193,7 +174,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_tag** -> FindTagResponse retrieve_tag(x_request_id, tag_id) +> FindTagResponse retrieve_tag(x_request_id, tag_id, x_trace_id=x_trace_id) Get specific tag by id @@ -204,11 +185,11 @@ Get attributes values to a specific tag on your account. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tags_api -from pfruck_contabo.model.find_tag_response import FindTagResponse +from pfruck_contabo.models.find_tag_response import FindTagResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -222,43 +203,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tags_api.TagsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.TagsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. tag_id = 12345 # int | The identifier of the tag - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Get specific tag by id - api_response = api_instance.retrieve_tag(x_request_id, tag_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagsApi->retrieve_tag: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get specific tag by id api_response = api_instance.retrieve_tag(x_request_id, tag_id, x_trace_id=x_trace_id) + print("The response of TagsApi->retrieve_tag:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagsApi->retrieve_tag: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **tag_id** | **int**| The identifier of the tag | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **tag_id** | **int**| The identifier of the tag | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -273,7 +247,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -283,7 +256,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_tag_list** -> ListTagResponse retrieve_tag_list(x_request_id) +> ListTagResponse retrieve_tag_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name) List tags @@ -294,11 +267,11 @@ List and filter all tags in your account * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tags_api -from pfruck_contabo.model.list_tag_response import ListTagResponse +from pfruck_contabo.models.list_tag_response import ListTagResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -312,51 +285,42 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tags_api.TagsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.TagsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - name = "web" # str | Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + name = 'web' # str | Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. (optional) - # example passing only required values which don't have defaults set - try: - # List tags - api_response = api_instance.retrieve_tag_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagsApi->retrieve_tag_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List tags api_response = api_instance.retrieve_tag_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name) + print("The response of TagsApi->retrieve_tag_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagsApi->retrieve_tag_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **name** | **str**| Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **name** | **str**| Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. | [optional] ### Return type @@ -371,7 +335,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -381,7 +344,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_tag** -> UpdateTagResponse update_tag(x_request_id, tag_id, update_tag_request) +> UpdateTagResponse update_tag(x_request_id, tag_id, update_tag_request, x_trace_id=x_trace_id) Update specific tag by id @@ -392,12 +355,12 @@ Update attributes to your tag. Attributes are optional. If not set, the attribut * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tags_api -from pfruck_contabo.model.update_tag_response import UpdateTagResponse -from pfruck_contabo.model.update_tag_request import UpdateTagRequest +from pfruck_contabo.models.update_tag_request import UpdateTagRequest +from pfruck_contabo.models.update_tag_response import UpdateTagResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -411,48 +374,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tags_api.TagsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + api_instance = pfruck_contabo.TagsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. tag_id = 12345 # int | The identifier of the tag - update_tag_request = UpdateTagRequest( - name="Updated-Web-Server", - color="#0A78C3", - ) # UpdateTagRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update specific tag by id - api_response = api_instance.update_tag(x_request_id, tag_id, update_tag_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagsApi->update_tag: %s\n" % e) + update_tag_request = pfruck_contabo.UpdateTagRequest() # UpdateTagRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update specific tag by id api_response = api_instance.update_tag(x_request_id, tag_id, update_tag_request, x_trace_id=x_trace_id) + print("The response of TagsApi->update_tag:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagsApi->update_tag: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **tag_id** | **int**| The identifier of the tag | - **update_tag_request** | [**UpdateTagRequest**](UpdateTagRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **tag_id** | **int**| The identifier of the tag | + **update_tag_request** | [**UpdateTagRequest**](UpdateTagRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -467,7 +420,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/TagsAuditsApi.md b/docs/TagsAuditsApi.md index abbd7a8..87737bc 100644 --- a/docs/TagsAuditsApi.md +++ b/docs/TagsAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_tag_audits_list** -> ListTagAuditsResponse retrieve_tag_audits_list(x_request_id) +> ListTagAuditsResponse retrieve_tag_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, tag_id=tag_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your assignments (audit) @@ -19,11 +19,11 @@ List and filters the history about your assignments. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import tags_audits_api -from pfruck_contabo.model.list_tag_audits_response import ListTagAuditsResponse +from pfruck_contabo.models.list_tag_audits_response import ListTagAuditsResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = tags_audits_api.TagsAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.TagsAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) tag_id = 12345 # int | The identifier of the tag. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | UserId of the user which led to the change. (optional) - start_date = dateutil_parser('2021-01-01').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-01-01').date() # date | End of search time range. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | UserId of the user which led to the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2021-01-01' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - try: - # List history about your assignments (audit) - api_response = api_instance.retrieve_tag_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling TagsAuditsApi->retrieve_tag_audits_list: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # List history about your assignments (audit) api_response = api_instance.retrieve_tag_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, tag_id=tag_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of TagsAuditsApi->retrieve_tag_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling TagsAuditsApi->retrieve_tag_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **tag_id** | **int**| The identifier of the tag. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| UserId of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **tag_id** | **int**| The identifier of the tag. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| UserId of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/UnassignInstancePrivateNetworkResponse.md b/docs/UnassignInstancePrivateNetworkResponse.md index a3a114b..cdc3dd8 100644 --- a/docs/UnassignInstancePrivateNetworkResponse.md +++ b/docs/UnassignInstancePrivateNetworkResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**AssignInstancePrivateNetworkResponseLinks**](AssignInstancePrivateNetworkResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**InstanceAssignmentSelfLinks**](InstanceAssignmentSelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UnassignInstancePrivateNetworkResponse from a JSON string +unassign_instance_private_network_response_instance = UnassignInstancePrivateNetworkResponse.from_json(json) +# print the JSON string representation of the object +print(UnassignInstancePrivateNetworkResponse.to_json()) +# convert the object into a dict +unassign_instance_private_network_response_dict = unassign_instance_private_network_response_instance.to_dict() +# create an instance of UnassignInstancePrivateNetworkResponse from a dict +unassign_instance_private_network_response_from_dict = UnassignInstancePrivateNetworkResponse.from_dict(unassign_instance_private_network_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateCustomImageRequest.md b/docs/UpdateCustomImageRequest.md index f30468d..97166dc 100644 --- a/docs/UpdateCustomImageRequest.md +++ b/docs/UpdateCustomImageRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Image Name | [optional] **description** | **str** | Image Description | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.update_custom_image_request import UpdateCustomImageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCustomImageRequest from a JSON string +update_custom_image_request_instance = UpdateCustomImageRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateCustomImageRequest.to_json()) + +# convert the object into a dict +update_custom_image_request_dict = update_custom_image_request_instance.to_dict() +# create an instance of UpdateCustomImageRequest from a dict +update_custom_image_request_from_dict = UpdateCustomImageRequest.from_dict(update_custom_image_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateCustomImageResponse.md b/docs/UpdateCustomImageResponse.md index c37a269..9f5cb09 100644 --- a/docs/UpdateCustomImageResponse.md +++ b/docs/UpdateCustomImageResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[UpdateCustomImageResponseData]**](UpdateCustomImageResponseData.md) | | -**links** | [**CreateCustomImageResponseLinks**](CreateCustomImageResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[UpdateCustomImageResponseData]**](UpdateCustomImageResponseData.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.update_custom_image_response import UpdateCustomImageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCustomImageResponse from a JSON string +update_custom_image_response_instance = UpdateCustomImageResponse.from_json(json) +# print the JSON string representation of the object +print(UpdateCustomImageResponse.to_json()) +# convert the object into a dict +update_custom_image_response_dict = update_custom_image_response_instance.to_dict() +# create an instance of UpdateCustomImageResponse from a dict +update_custom_image_response_from_dict = UpdateCustomImageResponse.from_dict(update_custom_image_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateCustomImageResponseData.md b/docs/UpdateCustomImageResponseData.md index c9623ed..5500442 100644 --- a/docs/UpdateCustomImageResponseData.md +++ b/docs/UpdateCustomImageResponseData.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **image_id** | **str** | Image's id | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.update_custom_image_response_data import UpdateCustomImageResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCustomImageResponseData from a JSON string +update_custom_image_response_data_instance = UpdateCustomImageResponseData.from_json(json) +# print the JSON string representation of the object +print(UpdateCustomImageResponseData.to_json()) + +# convert the object into a dict +update_custom_image_response_data_dict = update_custom_image_response_data_instance.to_dict() +# create an instance of UpdateCustomImageResponseData from a dict +update_custom_image_response_data_from_dict = UpdateCustomImageResponseData.from_dict(update_custom_image_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateRoleRequest.md b/docs/UpdateRoleRequest.md index c3f934d..ee61226 100644 --- a/docs/UpdateRoleRequest.md +++ b/docs/UpdateRoleRequest.md @@ -2,14 +2,31 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the role. There is a limit of 255 characters per role. | **admin** | **bool** | If user is admin he will have permissions to all API endpoints and resources. Enabling this will superseed all role definitions and `accessAllResources`. | **access_all_resources** | **bool** | Allow access to all resources. This will superseed all assigned resources in a role. | -**permissions** | [**[PermissionRequest]**](PermissionRequest.md) | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**permissions** | [**List[PermissionRequest]**](PermissionRequest.md) | | [optional] + +## Example + +```python +from pfruck_contabo.models.update_role_request import UpdateRoleRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateRoleRequest from a JSON string +update_role_request_instance = UpdateRoleRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateRoleRequest.to_json()) +# convert the object into a dict +update_role_request_dict = update_role_request_instance.to_dict() +# create an instance of UpdateRoleRequest from a dict +update_role_request_from_dict = UpdateRoleRequest.from_dict(update_role_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateRoleResponse.md b/docs/UpdateRoleResponse.md index c6b9d91..8bdc84c 100644 --- a/docs/UpdateRoleResponse.md +++ b/docs/UpdateRoleResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**UpdateRoleResponseLinks**](UpdateRoleResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.update_role_response import UpdateRoleResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateRoleResponse from a JSON string +update_role_response_instance = UpdateRoleResponse.from_json(json) +# print the JSON string representation of the object +print(UpdateRoleResponse.to_json()) +# convert the object into a dict +update_role_response_dict = update_role_response_instance.to_dict() +# create an instance of UpdateRoleResponse from a dict +update_role_response_from_dict = UpdateRoleResponse.from_dict(update_role_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateSecretRequest.md b/docs/UpdateSecretRequest.md index a94bd49..b7b11ec 100644 --- a/docs/UpdateSecretRequest.md +++ b/docs/UpdateSecretRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the secret to be saved | [optional] **value** | **str** | The value of the secret to be saved | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.update_secret_request import UpdateSecretRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSecretRequest from a JSON string +update_secret_request_instance = UpdateSecretRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateSecretRequest.to_json()) + +# convert the object into a dict +update_secret_request_dict = update_secret_request_instance.to_dict() +# create an instance of UpdateSecretRequest from a dict +update_secret_request_from_dict = UpdateSecretRequest.from_dict(update_secret_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateSecretResponse.md b/docs/UpdateSecretResponse.md index 2750b18..f80b029 100644 --- a/docs/UpdateSecretResponse.md +++ b/docs/UpdateSecretResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**UpdateSecretResponseLinks**](UpdateSecretResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.update_secret_response import UpdateSecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSecretResponse from a JSON string +update_secret_response_instance = UpdateSecretResponse.from_json(json) +# print the JSON string representation of the object +print(UpdateSecretResponse.to_json()) +# convert the object into a dict +update_secret_response_dict = update_secret_response_instance.to_dict() +# create an instance of UpdateSecretResponse from a dict +update_secret_response_from_dict = UpdateSecretResponse.from_dict(update_secret_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateSnapshotRequest.md b/docs/UpdateSnapshotRequest.md index bbb731e..c876723 100644 --- a/docs/UpdateSnapshotRequest.md +++ b/docs/UpdateSnapshotRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the snapshot. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot. | [optional] **description** | **str** | The description of the snapshot. There is a limit of 255 characters per snapshot. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.update_snapshot_request import UpdateSnapshotRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSnapshotRequest from a JSON string +update_snapshot_request_instance = UpdateSnapshotRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateSnapshotRequest.to_json()) + +# convert the object into a dict +update_snapshot_request_dict = update_snapshot_request_instance.to_dict() +# create an instance of UpdateSnapshotRequest from a dict +update_snapshot_request_from_dict = UpdateSnapshotRequest.from_dict(update_snapshot_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateSnapshotResponse.md b/docs/UpdateSnapshotResponse.md index 8e55d9b..240f736 100644 --- a/docs/UpdateSnapshotResponse.md +++ b/docs/UpdateSnapshotResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[SnapshotResponse]**](SnapshotResponse.md) | | -**links** | [**CreateSnapshotResponseLinks**](CreateSnapshotResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**data** | [**List[SnapshotResponse]**](SnapshotResponse.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | + +## Example + +```python +from pfruck_contabo.models.update_snapshot_response import UpdateSnapshotResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSnapshotResponse from a JSON string +update_snapshot_response_instance = UpdateSnapshotResponse.from_json(json) +# print the JSON string representation of the object +print(UpdateSnapshotResponse.to_json()) +# convert the object into a dict +update_snapshot_response_dict = update_snapshot_response_instance.to_dict() +# create an instance of UpdateSnapshotResponse from a dict +update_snapshot_response_from_dict = UpdateSnapshotResponse.from_dict(update_snapshot_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateTagRequest.md b/docs/UpdateTagRequest.md index 5df1b89..c8287fd 100644 --- a/docs/UpdateTagRequest.md +++ b/docs/UpdateTagRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. | [optional] **color** | **str** | The color of the tag. Color can be specified using hexadecimal value. Default color is #0A78C3 | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.update_tag_request import UpdateTagRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateTagRequest from a JSON string +update_tag_request_instance = UpdateTagRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateTagRequest.to_json()) + +# convert the object into a dict +update_tag_request_dict = update_tag_request_instance.to_dict() +# create an instance of UpdateTagRequest from a dict +update_tag_request_from_dict = UpdateTagRequest.from_dict(update_tag_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateTagResponse.md b/docs/UpdateTagResponse.md index d06b3c3..365438a 100644 --- a/docs/UpdateTagResponse.md +++ b/docs/UpdateTagResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**UpdateTagResponseLinks**](UpdateTagResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.update_tag_response import UpdateTagResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateTagResponse from a JSON string +update_tag_response_instance = UpdateTagResponse.from_json(json) +# print the JSON string representation of the object +print(UpdateTagResponse.to_json()) +# convert the object into a dict +update_tag_response_dict = update_tag_response_instance.to_dict() +# create an instance of UpdateTagResponse from a dict +update_tag_response_from_dict = UpdateTagResponse.from_dict(update_tag_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateUserRequest.md b/docs/UpdateUserRequest.md index e28ff40..dfa50a7 100644 --- a/docs/UpdateUserRequest.md +++ b/docs/UpdateUserRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **first_name** | **str** | The name of the user. Names may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user. | [optional] @@ -10,9 +11,25 @@ Name | Type | Description | Notes **enabled** | **bool** | If user is not enabled, he can't login and thus use services any longer. | [optional] **totp** | **bool** | Enable or disable two-factor authentication (2FA) via time based OTP. | [optional] **locale** | **str** | The locale of the user. This can be `de-DE`, `de`, `en-US`, `en` | [optional] -**roles** | **[int]** | The roles as list of `roleId`s of the user. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**roles** | **List[int]** | The roles as list of `roleId`s of the user. | [optional] + +## Example + +```python +from pfruck_contabo.models.update_user_request import UpdateUserRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateUserRequest from a JSON string +update_user_request_instance = UpdateUserRequest.from_json(json) +# print the JSON string representation of the object +print(UpdateUserRequest.to_json()) +# convert the object into a dict +update_user_request_dict = update_user_request_instance.to_dict() +# create an instance of UpdateUserRequest from a dict +update_user_request_from_dict = UpdateUserRequest.from_dict(update_user_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpdateUserResponse.md b/docs/UpdateUserResponse.md index 1a87436..49f0d8b 100644 --- a/docs/UpdateUserResponse.md +++ b/docs/UpdateUserResponse.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**UpdateUserResponseLinks**](UpdateUserResponseLinks.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | Links for easy navigation. | + +## Example + +```python +from pfruck_contabo.models.update_user_response import UpdateUserResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateUserResponse from a JSON string +update_user_response_instance = UpdateUserResponse.from_json(json) +# print the JSON string representation of the object +print(UpdateUserResponse.to_json()) +# convert the object into a dict +update_user_response_dict = update_user_response_instance.to_dict() +# create an instance of UpdateUserResponse from a dict +update_user_response_from_dict = UpdateUserResponse.from_dict(update_user_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpgradeAutoScalingType.md b/docs/UpgradeAutoScalingType.md index f8dded5..c29e73d 100644 --- a/docs/UpgradeAutoScalingType.md +++ b/docs/UpgradeAutoScalingType.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **state** | **str** | State of the autoscaling for the current object storage. | [optional] **size_limit_tb** | **float** | Autoscaling size limit for the current object storage. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.upgrade_auto_scaling_type import UpgradeAutoScalingType + +# TODO update the JSON string below +json = "{}" +# create an instance of UpgradeAutoScalingType from a JSON string +upgrade_auto_scaling_type_instance = UpgradeAutoScalingType.from_json(json) +# print the JSON string representation of the object +print(UpgradeAutoScalingType.to_json()) + +# convert the object into a dict +upgrade_auto_scaling_type_dict = upgrade_auto_scaling_type_instance.to_dict() +# create an instance of UpgradeAutoScalingType from a dict +upgrade_auto_scaling_type_from_dict = UpgradeAutoScalingType.from_dict(upgrade_auto_scaling_type_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpgradeInstanceRequest.md b/docs/UpgradeInstanceRequest.md index 14f67f4..d75bba5 100644 --- a/docs/UpgradeInstanceRequest.md +++ b/docs/UpgradeInstanceRequest.md @@ -2,11 +2,28 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**private_networking** | **bool, date, datetime, dict, float, int, list, str, none_type** | Set this attribute if you want to upgrade your instance with the Private Networking addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**private_networking** | **object** | Set this attribute if you want to upgrade your instance with the Private Networking addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future. | [optional] + +## Example + +```python +from pfruck_contabo.models.upgrade_instance_request import UpgradeInstanceRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpgradeInstanceRequest from a JSON string +upgrade_instance_request_instance = UpgradeInstanceRequest.from_json(json) +# print the JSON string representation of the object +print(UpgradeInstanceRequest.to_json()) +# convert the object into a dict +upgrade_instance_request_dict = upgrade_instance_request_instance.to_dict() +# create an instance of UpgradeInstanceRequest from a dict +upgrade_instance_request_from_dict = UpgradeInstanceRequest.from_dict(upgrade_instance_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpgradeObjectStorageRequest.md b/docs/UpgradeObjectStorageRequest.md index fcc6e4f..71b25d8 100644 --- a/docs/UpgradeObjectStorageRequest.md +++ b/docs/UpgradeObjectStorageRequest.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auto_scaling** | [**UpgradeObjectStorageRequestAutoScaling**](UpgradeObjectStorageRequestAutoScaling.md) | | [optional] +**auto_scaling** | [**UpgradeAutoScalingType**](UpgradeAutoScalingType.md) | New monthly object storage size limit for autoscaling if enabled. | [optional] **total_purchased_space_tb** | **float** | New total object storage limit. If this number is larger than before you will also be billed for the added storage space. No downgrade possible. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.upgrade_object_storage_request import UpgradeObjectStorageRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of UpgradeObjectStorageRequest from a JSON string +upgrade_object_storage_request_instance = UpgradeObjectStorageRequest.from_json(json) +# print the JSON string representation of the object +print(UpgradeObjectStorageRequest.to_json()) + +# convert the object into a dict +upgrade_object_storage_request_dict = upgrade_object_storage_request_instance.to_dict() +# create an instance of UpgradeObjectStorageRequest from a dict +upgrade_object_storage_request_from_dict = UpgradeObjectStorageRequest.from_dict(upgrade_object_storage_request_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpgradeObjectStorageResponse.md b/docs/UpgradeObjectStorageResponse.md index c2eb1be..97984f3 100644 --- a/docs/UpgradeObjectStorageResponse.md +++ b/docs/UpgradeObjectStorageResponse.md @@ -2,12 +2,29 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**links** | [**UpgradeObjectStorageResponseLinks**](UpgradeObjectStorageResponseLinks.md) | | -**data** | [**[UpgradeObjectStorageResponseData]**](UpgradeObjectStorageResponseData.md) | | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | +**data** | [**List[UpgradeObjectStorageResponseData]**](UpgradeObjectStorageResponseData.md) | | + +## Example + +```python +from pfruck_contabo.models.upgrade_object_storage_response import UpgradeObjectStorageResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpgradeObjectStorageResponse from a JSON string +upgrade_object_storage_response_instance = UpgradeObjectStorageResponse.from_json(json) +# print the JSON string representation of the object +print(UpgradeObjectStorageResponse.to_json()) +# convert the object into a dict +upgrade_object_storage_response_dict = upgrade_object_storage_response_instance.to_dict() +# create an instance of UpgradeObjectStorageResponse from a dict +upgrade_object_storage_response_from_dict = UpgradeObjectStorageResponse.from_dict(upgrade_object_storage_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UpgradeObjectStorageResponseData.md b/docs/UpgradeObjectStorageResponseData.md index 3c60d08..d33c4ef 100644 --- a/docs/UpgradeObjectStorageResponseData.md +++ b/docs/UpgradeObjectStorageResponseData.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -9,14 +10,30 @@ Name | Type | Description | Notes **object_storage_id** | **str** | Object storage id | **created_date** | **str** | Creation date for object storage. | **data_center** | **str** | Data center of the object storage. | -**auto_scaling** | [**UpgradeObjectStorageResponseDataAutoScaling**](UpgradeObjectStorageResponseDataAutoScaling.md) | | +**auto_scaling** | [**AutoScalingTypeResponse**](AutoScalingTypeResponse.md) | The autoscaling limit of the object storage. | **s3_url** | **str** | S3 URL to connect to your S3 compatible object storage | **status** | **str** | The object storage status | **total_purchased_space_tb** | **float** | Total purchased object storage space in TB. | **region** | **str** | The region where your object storage is located | **display_name** | **str** | Display name for object storage. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.upgrade_object_storage_response_data import UpgradeObjectStorageResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of UpgradeObjectStorageResponseData from a JSON string +upgrade_object_storage_response_data_instance = UpgradeObjectStorageResponseData.from_json(json) +# print the JSON string representation of the object +print(UpgradeObjectStorageResponseData.to_json()) + +# convert the object into a dict +upgrade_object_storage_response_data_dict = upgrade_object_storage_response_data_instance.to_dict() +# create an instance of UpgradeObjectStorageResponseData from a dict +upgrade_object_storage_response_data_from_dict = UpgradeObjectStorageResponseData.from_dict(upgrade_object_storage_response_data_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UserAuditResponse.md b/docs/UserAuditResponse.md index cd24417..2d93bc6 100644 --- a/docs/UserAuditResponse.md +++ b/docs/UserAuditResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | The identifier of the audit entry. | @@ -14,9 +15,25 @@ Name | Type | Description | Notes **request_id** | **str** | The requestId of the API call which led to the change. | **trace_id** | **str** | The traceId of the API call which led to the change. | **user_id** | **str** | The identifier of the user | -**changes** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | List of actual changes. | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +**changes** | **object** | List of actual changes. | [optional] + +## Example + +```python +from pfruck_contabo.models.user_audit_response import UserAuditResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UserAuditResponse from a JSON string +user_audit_response_instance = UserAuditResponse.from_json(json) +# print the JSON string representation of the object +print(UserAuditResponse.to_json()) +# convert the object into a dict +user_audit_response_dict = user_audit_response_instance.to_dict() +# create an instance of UserAuditResponse from a dict +user_audit_response_from_dict = UserAuditResponse.from_dict(user_audit_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UserIsPasswordSetResponse.md b/docs/UserIsPasswordSetResponse.md index 10becb4..7b7a85b 100644 --- a/docs/UserIsPasswordSetResponse.md +++ b/docs/UserIsPasswordSetResponse.md @@ -2,13 +2,30 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | **customer_id** | **str** | Your customer number | **is_password_set** | **bool** | Indicates if the user has set a password for his account | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.user_is_password_set_response import UserIsPasswordSetResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UserIsPasswordSetResponse from a JSON string +user_is_password_set_response_instance = UserIsPasswordSetResponse.from_json(json) +# print the JSON string representation of the object +print(UserIsPasswordSetResponse.to_json()) + +# convert the object into a dict +user_is_password_set_response_dict = user_is_password_set_response_instance.to_dict() +# create an instance of UserIsPasswordSetResponse from a dict +user_is_password_set_response_from_dict = UserIsPasswordSetResponse.from_dict(user_is_password_set_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UserResponse.md b/docs/UserResponse.md index c2adf9e..f6b1700 100644 --- a/docs/UserResponse.md +++ b/docs/UserResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -14,10 +15,26 @@ Name | Type | Description | Notes **enabled** | **bool** | If uses is not enabled, he can't login and thus use services any longer. | **totp** | **bool** | Enable or disable two-factor authentication (2FA) via time based OTP. | **locale** | **str** | The locale of the user. This can be `de-DE`, `de`, `en-US`, `en` | -**roles** | [**[RoleResponse]**](RoleResponse.md) | The roles as list of `roleId`s of the user. | +**roles** | [**List[RoleResponse]**](RoleResponse.md) | The roles as list of `roleId`s of the user. | **owner** | **bool** | If user is owner he will have permissions to all API endpoints and resources. Enabling this will superseed all role definitions and `accessAllResources`. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.user_response import UserResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UserResponse from a JSON string +user_response_instance = UserResponse.from_json(json) +# print the JSON string representation of the object +print(UserResponse.to_json()) + +# convert the object into a dict +user_response_dict = user_response_instance.to_dict() +# create an instance of UserResponse from a dict +user_response_from_dict = UserResponse.from_dict(user_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/UsersApi.md b/docs/UsersApi.md index 414f914..d15c4e7 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -19,7 +19,7 @@ Method | HTTP request | Description # **create_user** -> CreateUserResponse create_user(x_request_id, create_user_request) +> CreateUserResponse create_user(x_request_id, create_user_request, x_trace_id=x_trace_id) Create a new user @@ -30,12 +30,12 @@ Create a new user with required attributes name, email, enabled, totp (=Two-fact * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.create_user_request import CreateUserRequest -from pfruck_contabo.model.create_user_response import CreateUserResponse +from pfruck_contabo.models.create_user_request import CreateUserRequest +from pfruck_contabo.models.create_user_response import CreateUserResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -49,51 +49,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_user_request = CreateUserRequest( - first_name="John", - last_name="Doe", - email="john.doe@example.com", - enabled=False, - totp=False, - locale="de", - roles=[1,2,3,4], - ) # CreateUserRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Create a new user - api_response = api_instance.create_user(x_request_id, create_user_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->create_user: %s\n" % e) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_user_request = pfruck_contabo.CreateUserRequest() # CreateUserRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Create a new user api_response = api_instance.create_user(x_request_id, create_user_request, x_trace_id=x_trace_id) + print("The response of UsersApi->create_user:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->create_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **create_user_request** | [**CreateUserRequest**](CreateUserRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **create_user_request** | [**CreateUserRequest**](CreateUserRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -108,7 +93,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -118,7 +102,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_user** -> delete_user(x_request_id, user_id) +> delete_user(x_request_id, user_id, x_trace_id=x_trace_id) Delete existing user by id @@ -129,10 +113,10 @@ By deleting a user he will not be able to access any endpoints or resources any * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -146,41 +130,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Delete existing user by id - api_instance.delete_user(x_request_id, user_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->delete_user: %s\n" % e) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Delete existing user by id api_instance.delete_user(x_request_id, user_id, x_trace_id=x_trace_id) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->delete_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -195,7 +172,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -205,7 +181,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **generate_client_secret** -> GenerateClientSecretResponse generate_client_secret(x_request_id) +> GenerateClientSecretResponse generate_client_secret(x_request_id, x_trace_id=x_trace_id) Generate new client secret @@ -216,11 +192,11 @@ Generate and get new client secret. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.generate_client_secret_response import GenerateClientSecretResponse +from pfruck_contabo.models.generate_client_secret_response import GenerateClientSecretResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -234,41 +210,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Generate new client secret - api_response = api_instance.generate_client_secret(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->generate_client_secret: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Generate new client secret api_response = api_instance.generate_client_secret(x_request_id, x_trace_id=x_trace_id) + print("The response of UsersApi->generate_client_secret:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->generate_client_secret: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -283,7 +252,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -293,7 +261,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_object_storage_credentials** -> FindCredentialResponse get_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id) +> FindCredentialResponse get_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id, x_trace_id=x_trace_id) Get S3 compatible object storage credentials. @@ -304,11 +272,11 @@ Get S3 compatible object storage credentials for accessing it via S3 compatible * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.find_credential_response import FindCredentialResponse +from pfruck_contabo.models.find_credential_response import FindCredentialResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -322,47 +290,40 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - object_storage_id = "d8417276-d2d9-43a9-a0a8-9a6fa6060246" # str | The identifier of the S3 object storage + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + object_storage_id = 'd8417276-d2d9-43a9-a0a8-9a6fa6060246' # str | The identifier of the S3 object storage credential_id = 12345 # int | The ID of the object storage credential - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get S3 compatible object storage credentials. - api_response = api_instance.get_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->get_object_storage_credentials: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get S3 compatible object storage credentials. api_response = api_instance.get_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id, x_trace_id=x_trace_id) + print("The response of UsersApi->get_object_storage_credentials:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->get_object_storage_credentials: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **object_storage_id** | **str**| The identifier of the S3 object storage | - **credential_id** | **int**| The ID of the object storage credential | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **object_storage_id** | **str**| The identifier of the S3 object storage | + **credential_id** | **int**| The ID of the object storage credential | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -377,7 +338,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -387,7 +347,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_object_storage_credentials** -> ListCredentialResponse list_object_storage_credentials(x_request_id, user_id) +> ListCredentialResponse list_object_storage_credentials(x_request_id, user_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, object_storage_id=object_storage_id, region_name=region_name, display_name=display_name) Get list of S3 compatible object storage credentials for user. @@ -398,11 +358,11 @@ Get list of S3 compatible object storage credentials for accessing it via S3 com * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.list_credential_response import ListCredentialResponse +from pfruck_contabo.models.list_credential_response import ListCredentialResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -416,57 +376,48 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - object_storage_id = "d8417276-d2d9-43a9-a0a8-9a6fa6060246" # str | The identifier of the S3 object storage (optional) - region_name = "Asia (Singapore)" # str | Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central) (optional) - display_name = "Object Storage EU 420" # str | Filter for Object Storage by his displayName. (optional) - - # example passing only required values which don't have defaults set - try: - # Get list of S3 compatible object storage credentials for user. - api_response = api_instance.list_object_storage_credentials(x_request_id, user_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->list_object_storage_credentials: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + object_storage_id = 'd8417276-d2d9-43a9-a0a8-9a6fa6060246' # str | The identifier of the S3 object storage (optional) + region_name = 'Asia (Singapore)' # str | Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central) (optional) + display_name = 'Object Storage EU 420' # str | Filter for Object Storage by his displayName. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get list of S3 compatible object storage credentials for user. api_response = api_instance.list_object_storage_credentials(x_request_id, user_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, object_storage_id=object_storage_id, region_name=region_name, display_name=display_name) + print("The response of UsersApi->list_object_storage_credentials:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->list_object_storage_credentials: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **object_storage_id** | **str**| The identifier of the S3 object storage | [optional] - **region_name** | **str**| Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central) | [optional] - **display_name** | **str**| Filter for Object Storage by his displayName. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **object_storage_id** | **str**| The identifier of the S3 object storage | [optional] + **region_name** | **str**| Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central) | [optional] + **display_name** | **str**| Filter for Object Storage by his displayName. | [optional] ### Return type @@ -481,7 +432,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -491,7 +441,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **regenerate_object_storage_credentials** -> FindCredentialResponse regenerate_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id) +> FindCredentialResponse regenerate_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id, x_trace_id=x_trace_id) Regenerates secret key of specified user for the S3 compatible object storages. @@ -502,11 +452,11 @@ Regenerates secret key of specified user for the a specific S3 compatible object * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.find_credential_response import FindCredentialResponse +from pfruck_contabo.models.find_credential_response import FindCredentialResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -520,47 +470,40 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - object_storage_id = "d8417276-d2d9-43a9-a0a8-9a6fa6060246" # str | The identifier of the S3 object storage + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + object_storage_id = 'd8417276-d2d9-43a9-a0a8-9a6fa6060246' # str | The identifier of the S3 object storage credential_id = 12345 # int | The ID of the object storage credential - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Regenerates secret key of specified user for the S3 compatible object storages. - api_response = api_instance.regenerate_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->regenerate_object_storage_credentials: %s\n" % e) + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Regenerates secret key of specified user for the S3 compatible object storages. api_response = api_instance.regenerate_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id, x_trace_id=x_trace_id) + print("The response of UsersApi->regenerate_object_storage_credentials:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->regenerate_object_storage_credentials: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **object_storage_id** | **str**| The identifier of the S3 object storage | - **credential_id** | **int**| The ID of the object storage credential | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **object_storage_id** | **str**| The identifier of the S3 object storage | + **credential_id** | **int**| The ID of the object storage credential | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -575,7 +518,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -585,7 +527,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **resend_email_verification** -> resend_email_verification(x_request_id, user_id) +> resend_email_verification(x_request_id, user_id, x_trace_id=x_trace_id, redirect_url=redirect_url) Resend email verification @@ -596,10 +538,10 @@ Resend email verification for a specific user * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -613,43 +555,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - redirect_url = "https://test.contabo.de" # str | The redirect url used for email verification (optional) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + redirect_url = 'https://test.contabo.de' # str | The redirect url used for email verification (optional) - # example passing only required values which don't have defaults set - try: - # Resend email verification - api_instance.resend_email_verification(x_request_id, user_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->resend_email_verification: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Resend email verification api_instance.resend_email_verification(x_request_id, user_id, x_trace_id=x_trace_id, redirect_url=redirect_url) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->resend_email_verification: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **redirect_url** | **str**| The redirect url used for email verification | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **redirect_url** | **str**| The redirect url used for email verification | [optional] ### Return type @@ -664,7 +599,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -674,7 +608,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **reset_password** -> reset_password(x_request_id, user_id) +> reset_password(x_request_id, user_id, x_trace_id=x_trace_id, redirect_url=redirect_url) Send reset password email @@ -685,10 +619,10 @@ Send reset password email for a specific user * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -702,43 +636,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - redirect_url = "https://test.contabo.de" # str | The redirect url used for resetting password (optional) - - # example passing only required values which don't have defaults set - try: - # Send reset password email - api_instance.reset_password(x_request_id, user_id) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->reset_password: %s\n" % e) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) + redirect_url = 'https://test.contabo.de' # str | The redirect url used for resetting password (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Send reset password email api_instance.reset_password(x_request_id, user_id, x_trace_id=x_trace_id, redirect_url=redirect_url) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->reset_password: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **redirect_url** | **str**| The redirect url used for resetting password | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **redirect_url** | **str**| The redirect url used for resetting password | [optional] ### Return type @@ -753,7 +680,6 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined - ### HTTP response details | Status code | Description | Response headers | @@ -763,7 +689,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_user** -> FindUserResponse retrieve_user(x_request_id, user_id) +> FindUserResponse retrieve_user(x_request_id, user_id, x_trace_id=x_trace_id) Get specific user by id @@ -774,11 +700,11 @@ Get attributes for a specific user. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.find_user_response import FindUserResponse +from pfruck_contabo.models.find_user_response import FindUserResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -792,43 +718,36 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Get specific user by id - api_response = api_instance.retrieve_user(x_request_id, user_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->retrieve_user: %s\n" % e) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Get specific user by id api_response = api_instance.retrieve_user(x_request_id, user_id, x_trace_id=x_trace_id) + print("The response of UsersApi->retrieve_user:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->retrieve_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -843,7 +762,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -853,7 +771,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_user_client** -> FindClientResponse retrieve_user_client(x_request_id) +> FindClientResponse retrieve_user_client(x_request_id, x_trace_id=x_trace_id) Get client @@ -864,11 +782,11 @@ Get idm client. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.find_client_response import FindClientResponse +from pfruck_contabo.models.find_client_response import FindClientResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -882,41 +800,34 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - try: - # Get client - api_response = api_instance.retrieve_user_client(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->retrieve_user_client: %s\n" % e) - - # example passing only required values which don't have defaults set - # and optional values try: # Get client api_response = api_instance.retrieve_user_client(x_request_id, x_trace_id=x_trace_id) + print("The response of UsersApi->retrieve_user_client:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->retrieve_user_client: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -931,7 +842,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -941,7 +851,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **retrieve_user_list** -> ListUserResponse retrieve_user_list(x_request_id) +> ListUserResponse retrieve_user_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, email=email, enabled=enabled, owner=owner) List users @@ -952,11 +862,11 @@ List and filter all your users. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.list_user_response import ListUserResponse +from pfruck_contabo.models.list_user_response import ListUserResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -970,55 +880,46 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - email = "john.doe@example.com" # str | Filter as substring match for user emails. (optional) - enabled = True # bool | Filter if user is enabled or not. (optional) - owner = True # bool | Filter if user is owner or not. (optional) - - # example passing only required values which don't have defaults set - try: - # List users - api_response = api_instance.retrieve_user_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->retrieve_user_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + email = 'john.doe@example.com' # str | Filter as substring match for user emails. (optional) + enabled = true # bool | Filter if user is enabled or not. (optional) + owner = true # bool | Filter if user is owner or not. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List users api_response = api_instance.retrieve_user_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, email=email, enabled=enabled, owner=owner) + print("The response of UsersApi->retrieve_user_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->retrieve_user_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **email** | **str**| Filter as substring match for user emails. | [optional] - **enabled** | **bool**| Filter if user is enabled or not. | [optional] - **owner** | **bool**| Filter if user is owner or not. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **email** | **str**| Filter as substring match for user emails. | [optional] + **enabled** | **bool**| Filter if user is enabled or not. | [optional] + **owner** | **bool**| Filter if user is owner or not. | [optional] ### Return type @@ -1033,7 +934,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | @@ -1043,7 +943,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> UpdateUserResponse update_user(x_request_id, user_id, update_user_request) +> UpdateUserResponse update_user(x_request_id, user_id, update_user_request, x_trace_id=x_trace_id) Update specific user by id @@ -1054,12 +954,12 @@ Update attributes of a user. You may only specify the attributes you want to cha * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_api -from pfruck_contabo.model.update_user_response import UpdateUserResponse -from pfruck_contabo.model.update_user_request import UpdateUserRequest +from pfruck_contabo.models.update_user_request import UpdateUserRequest +from pfruck_contabo.models.update_user_response import UpdateUserResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -1073,53 +973,38 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_api.UsersApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. - update_user_request = UpdateUserRequest( - first_name="John", - last_name="Doe", - email="john.doe@example.com", - enabled=False, - totp=False, - locale="de", - roles=[1,2,3,4], - ) # UpdateUserRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) - - # example passing only required values which don't have defaults set - try: - # Update specific user by id - api_response = api_instance.update_user(x_request_id, user_id, update_user_request) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersApi->update_user: %s\n" % e) + api_instance = pfruck_contabo.UsersApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. + update_user_request = pfruck_contabo.UpdateUserRequest() # UpdateUserRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # Update specific user by id api_response = api_instance.update_user(x_request_id, user_id, update_user_request, x_trace_id=x_trace_id) + print("The response of UsersApi->update_user:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersApi->update_user: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **user_id** | **str**| The identifier of the user. | - **update_user_request** | [**UpdateUserRequest**](UpdateUserRequest.md)| | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **user_id** | **str**| The identifier of the user. | + **update_user_request** | [**UpdateUserRequest**](UpdateUserRequest.md)| | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] ### Return type @@ -1134,7 +1019,6 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/UsersAuditsApi.md b/docs/UsersAuditsApi.md index 24a78d1..ba6cb42 100644 --- a/docs/UsersAuditsApi.md +++ b/docs/UsersAuditsApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **retrieve_user_audits_list** -> ListUserAuditResponse retrieve_user_audits_list(x_request_id) +> ListUserAuditResponse retrieve_user_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, user_id=user_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) List history about your users (audit) @@ -19,11 +19,11 @@ List and filter the history about your users. * Bearer (JWT) Authentication (bearer): ```python -import time import pfruck_contabo -from pfruck_contabo.api import users_audits_api -from pfruck_contabo.model.list_user_audit_response import ListUserAuditResponse +from pfruck_contabo.models.list_user_audit_response import ListUserAuditResponse +from pfruck_contabo.rest import ApiException from pprint import pprint + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -37,59 +37,50 @@ configuration = pfruck_contabo.Configuration( # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = users_audits_api.UsersAuditsApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.UsersAuditsApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) page = 1 # int | Number of page to be fetched. (optional) size = 10 # int | Number of elements per page. (optional) - order_by = [ - "name:asc", - ] # [str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) - user_id = "6cdf5968-f9fe-4192-97c2-f349e813c5e8" # str | The identifier of the user. (optional) - request_id = "D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3" # str | The requestId of the API call which led to the change. (optional) - changed_by = "23cbb6d6-cb11-4330-bdff-7bb791df2e23" # str | changedBy of the user which led to the change. (optional) - start_date = dateutil_parser('2021-01-01').date() # date | Start of search time range. (optional) - end_date = dateutil_parser('2021-01-01').date() # date | End of search time range. (optional) - - # example passing only required values which don't have defaults set - try: - # List history about your users (audit) - api_response = api_instance.retrieve_user_audits_list(x_request_id) - pprint(api_response) - except pfruck_contabo.ApiException as e: - print("Exception when calling UsersAuditsApi->retrieve_user_audits_list: %s\n" % e) + order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) + user_id = '6cdf5968-f9fe-4192-97c2-f349e813c5e8' # str | The identifier of the user. (optional) + request_id = 'D5FD9FAF-58C0-4406-8F46-F449B8E4FEC3' # str | The requestId of the API call which led to the change. (optional) + changed_by = '23cbb6d6-cb11-4330-bdff-7bb791df2e23' # str | changedBy of the user which led to the change. (optional) + start_date = '2021-01-01' # date | Start of search time range. (optional) + end_date = '2021-01-01' # date | End of search time range. (optional) - # example passing only required values which don't have defaults set - # and optional values try: # List history about your users (audit) api_response = api_instance.retrieve_user_audits_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, user_id=user_id, request_id=request_id, changed_by=changed_by, start_date=start_date, end_date=end_date) + print("The response of UsersAuditsApi->retrieve_user_audits_list:\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except Exception as e: print("Exception when calling UsersAuditsApi->retrieve_user_audits_list: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | - **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] - **page** | **int**| Number of page to be fetched. | [optional] - **size** | **int**| Number of elements per page. | [optional] - **order_by** | **[str]**| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] - **user_id** | **str**| The identifier of the user. | [optional] - **request_id** | **str**| The requestId of the API call which led to the change. | [optional] - **changed_by** | **str**| changedBy of the user which led to the change. | [optional] - **start_date** | **date**| Start of search time range. | [optional] - **end_date** | **date**| End of search time range. | [optional] + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + **page** | **int**| Number of page to be fetched. | [optional] + **size** | **int**| Number of elements per page. | [optional] + **order_by** | [**List[str]**](str.md)| Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. | [optional] + **user_id** | **str**| The identifier of the user. | [optional] + **request_id** | **str**| The requestId of the API call which led to the change. | [optional] + **changed_by** | **str**| changedBy of the user which led to the change. | [optional] + **start_date** | **date**| Start of search time range. | [optional] + **end_date** | **date**| End of search time range. | [optional] ### Return type @@ -104,7 +95,6 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json - ### HTTP response details | Status code | Description | Response headers | diff --git a/docs/VncResponse.md b/docs/VncResponse.md index 63491d3..b28542a 100644 --- a/docs/VncResponse.md +++ b/docs/VncResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tenant_id** | **str** | Your customer tenant id | @@ -10,8 +11,24 @@ Name | Type | Description | Notes **enabled** | **bool** | VNC Status for the instance. | **vnc_ip** | **str** | VNC IP for the instance. | **vnc_port** | **float** | VNC Port for the instance. | -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] +## Example + +```python +from pfruck_contabo.models.vnc_response import VncResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of VncResponse from a JSON string +vnc_response_instance = VncResponse.from_json(json) +# print the JSON string representation of the object +print(VncResponse.to_json()) + +# convert the object into a dict +vnc_response_dict = vnc_response_instance.to_dict() +# create an instance of VncResponse from a dict +vnc_response_from_dict = VncResponse.from_dict(vnc_response_dict) +``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pfruck_contabo/__init__.py b/pfruck_contabo/__init__.py index b92c930..60cdea6 100644 --- a/pfruck_contabo/__init__.py +++ b/pfruck_contabo/__init__.py @@ -1,3 +1,5 @@ +# coding: utf-8 + # flake8: noqa """ @@ -6,22 +8,230 @@ The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 __version__ = "1.12.0" +# import apis into sdk package +from pfruck_contabo.api.images_api import ImagesApi +from pfruck_contabo.api.images_audits_api import ImagesAuditsApi +from pfruck_contabo.api.instance_actions_api import InstanceActionsApi +from pfruck_contabo.api.instance_actions_audits_api import InstanceActionsAuditsApi +from pfruck_contabo.api.instances_api import InstancesApi +from pfruck_contabo.api.instances_audits_api import InstancesAuditsApi +from pfruck_contabo.api.internal_api import InternalApi +from pfruck_contabo.api.object_storages_api import ObjectStoragesApi +from pfruck_contabo.api.object_storages_audits_api import ObjectStoragesAuditsApi +from pfruck_contabo.api.private_networks_api import PrivateNetworksApi +from pfruck_contabo.api.private_networks_audits_api import PrivateNetworksAuditsApi +from pfruck_contabo.api.roles_api import RolesApi +from pfruck_contabo.api.roles_audits_api import RolesAuditsApi +from pfruck_contabo.api.secrets_api import SecretsApi +from pfruck_contabo.api.secrets_audits_api import SecretsAuditsApi +from pfruck_contabo.api.snapshots_api import SnapshotsApi +from pfruck_contabo.api.snapshots_audits_api import SnapshotsAuditsApi +from pfruck_contabo.api.tag_assignments_api import TagAssignmentsApi +from pfruck_contabo.api.tag_assignments_audits_api import TagAssignmentsAuditsApi +from pfruck_contabo.api.tags_api import TagsApi +from pfruck_contabo.api.tags_audits_api import TagsAuditsApi +from pfruck_contabo.api.users_api import UsersApi +from pfruck_contabo.api.users_audits_api import UsersAuditsApi + # import ApiClient +from pfruck_contabo.api_response import ApiResponse from pfruck_contabo.api_client import ApiClient - -# import Configuration from pfruck_contabo.configuration import Configuration - -# import exceptions from pfruck_contabo.exceptions import OpenApiException -from pfruck_contabo.exceptions import ApiAttributeError from pfruck_contabo.exceptions import ApiTypeError from pfruck_contabo.exceptions import ApiValueError from pfruck_contabo.exceptions import ApiKeyError +from pfruck_contabo.exceptions import ApiAttributeError from pfruck_contabo.exceptions import ApiException + +# import models into sdk package +from pfruck_contabo.models.add_on_quantity_request import AddOnQuantityRequest +from pfruck_contabo.models.add_on_request import AddOnRequest +from pfruck_contabo.models.add_on_response import AddOnResponse +from pfruck_contabo.models.additional_ip import AdditionalIp +from pfruck_contabo.models.api_permissions_response import ApiPermissionsResponse +from pfruck_contabo.models.application_config import ApplicationConfig +from pfruck_contabo.models.application_requirements import ApplicationRequirements +from pfruck_contabo.models.application_response import ApplicationResponse +from pfruck_contabo.models.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse +from pfruck_contabo.models.assigned_tag_response import AssignedTagResponse +from pfruck_contabo.models.assignment_audit_response import AssignmentAuditResponse +from pfruck_contabo.models.assignment_response import AssignmentResponse +from pfruck_contabo.models.auto_scaling_type_request import AutoScalingTypeRequest +from pfruck_contabo.models.auto_scaling_type_response import AutoScalingTypeResponse +from pfruck_contabo.models.cancel_instance_response import CancelInstanceResponse +from pfruck_contabo.models.cancel_instance_response_data import CancelInstanceResponseData +from pfruck_contabo.models.cancel_object_storage_response import CancelObjectStorageResponse +from pfruck_contabo.models.cancel_object_storage_response_data import CancelObjectStorageResponseData +from pfruck_contabo.models.client_response import ClientResponse +from pfruck_contabo.models.client_secret_response import ClientSecretResponse +from pfruck_contabo.models.create_assignment_response import CreateAssignmentResponse +from pfruck_contabo.models.create_custom_image_fail_response import CreateCustomImageFailResponse +from pfruck_contabo.models.create_custom_image_request import CreateCustomImageRequest +from pfruck_contabo.models.create_custom_image_response import CreateCustomImageResponse +from pfruck_contabo.models.create_custom_image_response_data import CreateCustomImageResponseData +from pfruck_contabo.models.create_instance_addons import CreateInstanceAddons +from pfruck_contabo.models.create_instance_request import CreateInstanceRequest +from pfruck_contabo.models.create_instance_response import CreateInstanceResponse +from pfruck_contabo.models.create_instance_response_data import CreateInstanceResponseData +from pfruck_contabo.models.create_object_storage_request import CreateObjectStorageRequest +from pfruck_contabo.models.create_object_storage_response import CreateObjectStorageResponse +from pfruck_contabo.models.create_object_storage_response_data import CreateObjectStorageResponseData +from pfruck_contabo.models.create_private_network_request import CreatePrivateNetworkRequest +from pfruck_contabo.models.create_private_network_response import CreatePrivateNetworkResponse +from pfruck_contabo.models.create_role_request import CreateRoleRequest +from pfruck_contabo.models.create_role_response import CreateRoleResponse +from pfruck_contabo.models.create_role_response_data import CreateRoleResponseData +from pfruck_contabo.models.create_secret_request import CreateSecretRequest +from pfruck_contabo.models.create_secret_response import CreateSecretResponse +from pfruck_contabo.models.create_snapshot_request import CreateSnapshotRequest +from pfruck_contabo.models.create_snapshot_response import CreateSnapshotResponse +from pfruck_contabo.models.create_tag_request import CreateTagRequest +from pfruck_contabo.models.create_tag_response import CreateTagResponse +from pfruck_contabo.models.create_tag_response_data import CreateTagResponseData +from pfruck_contabo.models.create_ticket_request import CreateTicketRequest +from pfruck_contabo.models.create_ticket_response import CreateTicketResponse +from pfruck_contabo.models.create_ticket_response_data import CreateTicketResponseData +from pfruck_contabo.models.create_user_request import CreateUserRequest +from pfruck_contabo.models.create_user_response import CreateUserResponse +from pfruck_contabo.models.create_user_response_data import CreateUserResponseData +from pfruck_contabo.models.credential_data import CredentialData +from pfruck_contabo.models.custom_images_stats_response import CustomImagesStatsResponse +from pfruck_contabo.models.custom_images_stats_response_data import CustomImagesStatsResponseData +from pfruck_contabo.models.data_center_response import DataCenterResponse +from pfruck_contabo.models.extra_storage_request import ExtraStorageRequest +from pfruck_contabo.models.find_assignment_response import FindAssignmentResponse +from pfruck_contabo.models.find_client_response import FindClientResponse +from pfruck_contabo.models.find_credential_response import FindCredentialResponse +from pfruck_contabo.models.find_image_response import FindImageResponse +from pfruck_contabo.models.find_instance_response import FindInstanceResponse +from pfruck_contabo.models.find_object_storage_response import FindObjectStorageResponse +from pfruck_contabo.models.find_private_network_response import FindPrivateNetworkResponse +from pfruck_contabo.models.find_role_response import FindRoleResponse +from pfruck_contabo.models.find_secret_response import FindSecretResponse +from pfruck_contabo.models.find_snapshot_response import FindSnapshotResponse +from pfruck_contabo.models.find_tag_response import FindTagResponse +from pfruck_contabo.models.find_user_is_password_set_response import FindUserIsPasswordSetResponse +from pfruck_contabo.models.find_user_response import FindUserResponse +from pfruck_contabo.models.find_vnc_response import FindVncResponse +from pfruck_contabo.models.firewalling_upgrade_request import FirewallingUpgradeRequest +from pfruck_contabo.models.generate_client_secret_response import GenerateClientSecretResponse +from pfruck_contabo.models.image_audit_response import ImageAuditResponse +from pfruck_contabo.models.image_audit_response_data import ImageAuditResponseData +from pfruck_contabo.models.image_response import ImageResponse +from pfruck_contabo.models.instance_assignment_self_links import InstanceAssignmentSelfLinks +from pfruck_contabo.models.instance_rescue_action_response import InstanceRescueActionResponse +from pfruck_contabo.models.instance_rescue_action_response_data import InstanceRescueActionResponseData +from pfruck_contabo.models.instance_reset_password_action_response import InstanceResetPasswordActionResponse +from pfruck_contabo.models.instance_reset_password_action_response_data import InstanceResetPasswordActionResponseData +from pfruck_contabo.models.instance_response import InstanceResponse +from pfruck_contabo.models.instance_restart_action_response import InstanceRestartActionResponse +from pfruck_contabo.models.instance_restart_action_response_data import InstanceRestartActionResponseData +from pfruck_contabo.models.instance_shutdown_action_response import InstanceShutdownActionResponse +from pfruck_contabo.models.instance_shutdown_action_response_data import InstanceShutdownActionResponseData +from pfruck_contabo.models.instance_start_action_response import InstanceStartActionResponse +from pfruck_contabo.models.instance_start_action_response_data import InstanceStartActionResponseData +from pfruck_contabo.models.instance_status import InstanceStatus +from pfruck_contabo.models.instance_stop_action_response import InstanceStopActionResponse +from pfruck_contabo.models.instance_stop_action_response_data import InstanceStopActionResponseData +from pfruck_contabo.models.instances import Instances +from pfruck_contabo.models.instances_actions_audit_response import InstancesActionsAuditResponse +from pfruck_contabo.models.instances_actions_rescue_request import InstancesActionsRescueRequest +from pfruck_contabo.models.instances_audit_response import InstancesAuditResponse +from pfruck_contabo.models.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest +from pfruck_contabo.models.ip_config import IpConfig +from pfruck_contabo.models.ip_v4 import IpV4 +from pfruck_contabo.models.ip_v6 import IpV6 +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.list_api_permission_response import ListApiPermissionResponse +from pfruck_contabo.models.list_applications_response import ListApplicationsResponse +from pfruck_contabo.models.list_assignment_audits_response import ListAssignmentAuditsResponse +from pfruck_contabo.models.list_assignment_response import ListAssignmentResponse +from pfruck_contabo.models.list_credential_response import ListCredentialResponse +from pfruck_contabo.models.list_data_center_response import ListDataCenterResponse +from pfruck_contabo.models.list_image_response import ListImageResponse +from pfruck_contabo.models.list_image_response_data import ListImageResponseData +from pfruck_contabo.models.list_instances_actions_audit_response import ListInstancesActionsAuditResponse +from pfruck_contabo.models.list_instances_audit_response import ListInstancesAuditResponse +from pfruck_contabo.models.list_instances_response import ListInstancesResponse +from pfruck_contabo.models.list_instances_response_data import ListInstancesResponseData +from pfruck_contabo.models.list_object_storage_audit_response import ListObjectStorageAuditResponse +from pfruck_contabo.models.list_object_storage_response import ListObjectStorageResponse +from pfruck_contabo.models.list_private_network_audit_response import ListPrivateNetworkAuditResponse +from pfruck_contabo.models.list_private_network_response import ListPrivateNetworkResponse +from pfruck_contabo.models.list_private_network_response_data import ListPrivateNetworkResponseData +from pfruck_contabo.models.list_role_audit_response import ListRoleAuditResponse +from pfruck_contabo.models.list_role_response import ListRoleResponse +from pfruck_contabo.models.list_secret_audit_response import ListSecretAuditResponse +from pfruck_contabo.models.list_secret_response import ListSecretResponse +from pfruck_contabo.models.list_snapshot_response import ListSnapshotResponse +from pfruck_contabo.models.list_snapshots_audit_response import ListSnapshotsAuditResponse +from pfruck_contabo.models.list_tag_audits_response import ListTagAuditsResponse +from pfruck_contabo.models.list_tag_response import ListTagResponse +from pfruck_contabo.models.list_user_audit_response import ListUserAuditResponse +from pfruck_contabo.models.list_user_response import ListUserResponse +from pfruck_contabo.models.minimum_requirements import MinimumRequirements +from pfruck_contabo.models.object_storage_audit_response import ObjectStorageAuditResponse +from pfruck_contabo.models.object_storage_response import ObjectStorageResponse +from pfruck_contabo.models.object_storages_stats_response import ObjectStoragesStatsResponse +from pfruck_contabo.models.object_storages_stats_response_data import ObjectStoragesStatsResponseData +from pfruck_contabo.models.optimal_requirements import OptimalRequirements +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.patch_instance_request import PatchInstanceRequest +from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse +from pfruck_contabo.models.patch_instance_response_data import PatchInstanceResponseData +from pfruck_contabo.models.patch_object_storage_request import PatchObjectStorageRequest +from pfruck_contabo.models.patch_private_network_request import PatchPrivateNetworkRequest +from pfruck_contabo.models.patch_private_network_response import PatchPrivateNetworkResponse +from pfruck_contabo.models.patch_vnc_request import PatchVncRequest +from pfruck_contabo.models.permission_request import PermissionRequest +from pfruck_contabo.models.permission_response import PermissionResponse +from pfruck_contabo.models.private_ip_config import PrivateIpConfig +from pfruck_contabo.models.private_network_audit_response import PrivateNetworkAuditResponse +from pfruck_contabo.models.private_network_response import PrivateNetworkResponse +from pfruck_contabo.models.reinstall_instance_request import ReinstallInstanceRequest +from pfruck_contabo.models.reinstall_instance_response import ReinstallInstanceResponse +from pfruck_contabo.models.reinstall_instance_response_data import ReinstallInstanceResponseData +from pfruck_contabo.models.resource_permissions_response import ResourcePermissionsResponse +from pfruck_contabo.models.role_audit_response import RoleAuditResponse +from pfruck_contabo.models.role_response import RoleResponse +from pfruck_contabo.models.rollback_snapshot_response import RollbackSnapshotResponse +from pfruck_contabo.models.secret_audit_response import SecretAuditResponse +from pfruck_contabo.models.secret_response import SecretResponse +from pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.snapshot_response import SnapshotResponse +from pfruck_contabo.models.snapshots_audit_response import SnapshotsAuditResponse +from pfruck_contabo.models.tag_assignment_self_links import TagAssignmentSelfLinks +from pfruck_contabo.models.tag_audit_response import TagAuditResponse +from pfruck_contabo.models.tag_response import TagResponse +from pfruck_contabo.models.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse +from pfruck_contabo.models.update_custom_image_request import UpdateCustomImageRequest +from pfruck_contabo.models.update_custom_image_response import UpdateCustomImageResponse +from pfruck_contabo.models.update_custom_image_response_data import UpdateCustomImageResponseData +from pfruck_contabo.models.update_role_request import UpdateRoleRequest +from pfruck_contabo.models.update_role_response import UpdateRoleResponse +from pfruck_contabo.models.update_secret_request import UpdateSecretRequest +from pfruck_contabo.models.update_secret_response import UpdateSecretResponse +from pfruck_contabo.models.update_snapshot_request import UpdateSnapshotRequest +from pfruck_contabo.models.update_snapshot_response import UpdateSnapshotResponse +from pfruck_contabo.models.update_tag_request import UpdateTagRequest +from pfruck_contabo.models.update_tag_response import UpdateTagResponse +from pfruck_contabo.models.update_user_request import UpdateUserRequest +from pfruck_contabo.models.update_user_response import UpdateUserResponse +from pfruck_contabo.models.upgrade_auto_scaling_type import UpgradeAutoScalingType +from pfruck_contabo.models.upgrade_instance_request import UpgradeInstanceRequest +from pfruck_contabo.models.upgrade_object_storage_request import UpgradeObjectStorageRequest +from pfruck_contabo.models.upgrade_object_storage_response import UpgradeObjectStorageResponse +from pfruck_contabo.models.upgrade_object_storage_response_data import UpgradeObjectStorageResponseData +from pfruck_contabo.models.user_audit_response import UserAuditResponse +from pfruck_contabo.models.user_is_password_set_response import UserIsPasswordSetResponse +from pfruck_contabo.models.user_response import UserResponse +from pfruck_contabo.models.vnc_response import VncResponse diff --git a/pfruck_contabo/api/__init__.py b/pfruck_contabo/api/__init__.py index 9744111..a65190c 100644 --- a/pfruck_contabo/api/__init__.py +++ b/pfruck_contabo/api/__init__.py @@ -1,3 +1,27 @@ -# do not import all apis into this module because that uses a lot of memory and stack frames -# if you need the ability to import all apis from one package, import them with -# from pfruck_contabo.apis import ImagesApi +# flake8: noqa + +# import apis into api package +from pfruck_contabo.api.images_api import ImagesApi +from pfruck_contabo.api.images_audits_api import ImagesAuditsApi +from pfruck_contabo.api.instance_actions_api import InstanceActionsApi +from pfruck_contabo.api.instance_actions_audits_api import InstanceActionsAuditsApi +from pfruck_contabo.api.instances_api import InstancesApi +from pfruck_contabo.api.instances_audits_api import InstancesAuditsApi +from pfruck_contabo.api.internal_api import InternalApi +from pfruck_contabo.api.object_storages_api import ObjectStoragesApi +from pfruck_contabo.api.object_storages_audits_api import ObjectStoragesAuditsApi +from pfruck_contabo.api.private_networks_api import PrivateNetworksApi +from pfruck_contabo.api.private_networks_audits_api import PrivateNetworksAuditsApi +from pfruck_contabo.api.roles_api import RolesApi +from pfruck_contabo.api.roles_audits_api import RolesAuditsApi +from pfruck_contabo.api.secrets_api import SecretsApi +from pfruck_contabo.api.secrets_audits_api import SecretsAuditsApi +from pfruck_contabo.api.snapshots_api import SnapshotsApi +from pfruck_contabo.api.snapshots_audits_api import SnapshotsAuditsApi +from pfruck_contabo.api.tag_assignments_api import TagAssignmentsApi +from pfruck_contabo.api.tag_assignments_audits_api import TagAssignmentsAuditsApi +from pfruck_contabo.api.tags_api import TagsApi +from pfruck_contabo.api.tags_audits_api import TagsAuditsApi +from pfruck_contabo.api.users_api import UsersApi +from pfruck_contabo.api.users_audits_api import UsersAuditsApi + diff --git a/pfruck_contabo/api/images_api.py b/pfruck_contabo/api/images_api.py index 184f9d8..970e711 100644 --- a/pfruck_contabo/api/images_api.py +++ b/pfruck_contabo/api/images_api.py @@ -1,1008 +1,1867 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_custom_image_request import CreateCustomImageRequest +from pfruck_contabo.models.create_custom_image_response import CreateCustomImageResponse +from pfruck_contabo.models.custom_images_stats_response import CustomImagesStatsResponse +from pfruck_contabo.models.find_image_response import FindImageResponse +from pfruck_contabo.models.list_image_response import ListImageResponse +from pfruck_contabo.models.update_custom_image_request import UpdateCustomImageRequest +from pfruck_contabo.models.update_custom_image_response import UpdateCustomImageResponse -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_custom_image_fail_response import CreateCustomImageFailResponse -from pfruck_contabo.model.create_custom_image_request import CreateCustomImageRequest -from pfruck_contabo.model.create_custom_image_response import CreateCustomImageResponse -from pfruck_contabo.model.custom_images_stats_response import CustomImagesStatsResponse -from pfruck_contabo.model.find_image_response import FindImageResponse -from pfruck_contabo.model.list_image_response import ListImageResponse -from pfruck_contabo.model.update_custom_image_request import UpdateCustomImageRequest -from pfruck_contabo.model.update_custom_image_response import UpdateCustomImageResponse - - -class ImagesApi(object): +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class ImagesApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_custom_image_endpoint = _Endpoint( - settings={ - 'response_type': (CreateCustomImageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/images', - 'operation_id': 'create_custom_image', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_custom_image_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_custom_image_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_custom_image_request': - (CreateCustomImageRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_custom_image_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.delete_image_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/images/{imageId}', - 'operation_id': 'delete_image', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'image_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'image_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'image_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'image_id': 'imageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'image_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_custom_images_stats_endpoint = _Endpoint( - settings={ - 'response_type': (CustomImagesStatsResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/images/stats', - 'operation_id': 'retrieve_custom_images_stats', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_image_endpoint = _Endpoint( - settings={ - 'response_type': (FindImageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/images/{imageId}', - 'operation_id': 'retrieve_image', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'image_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'image_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'image_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'image_id': 'imageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'image_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_image_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListImageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/images', - 'operation_id': 'retrieve_image_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'name', - 'standard_image', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'name': - (str,), - 'standard_image': - (bool,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'name': 'name', - 'standard_image': 'standardImage', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'name': 'query', - 'standard_image': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_image_endpoint = _Endpoint( - settings={ - 'response_type': (UpdateCustomImageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/images/{imageId}', - 'operation_id': 'update_image', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'image_id', - 'update_custom_image_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'image_id', - 'update_custom_image_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'image_id': - (str,), - 'update_custom_image_request': - (UpdateCustomImageRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'image_id': 'imageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'image_id': 'path', - 'update_custom_image_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def create_custom_image( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_custom_image_request: CreateCustomImageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateCustomImageResponse: + """Provide a custom image + + In order to provide a custom image please specify an URL from where the image can be directly downloaded. A custom image must be in either `.iso` or `.qcow2` format. Other formats will be rejected. Please note that downloading can take a while depending on network speed resp. bandwidth and size of image. You can check the status by retrieving information about the image via a GET request. Download will be rejected if you have exceeded your limits. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_custom_image_request: (required) + :type create_custom_image_request: CreateCustomImageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_image_serialize( + x_request_id=x_request_id, + create_custom_image_request=create_custom_image_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCustomImageResponse", + '415': "CreateCustomImageFailResponse", + } + 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_custom_image_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_custom_image_request: CreateCustomImageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateCustomImageResponse]: + """Provide a custom image + + In order to provide a custom image please specify an URL from where the image can be directly downloaded. A custom image must be in either `.iso` or `.qcow2` format. Other formats will be rejected. Please note that downloading can take a while depending on network speed resp. bandwidth and size of image. You can check the status by retrieving information about the image via a GET request. Download will be rejected if you have exceeded your limits. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_custom_image_request: (required) + :type create_custom_image_request: CreateCustomImageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_image_serialize( + x_request_id=x_request_id, + create_custom_image_request=create_custom_image_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCustomImageResponse", + '415': "CreateCustomImageFailResponse", + } + 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_custom_image_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_custom_image_request: CreateCustomImageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Provide a custom image + + In order to provide a custom image please specify an URL from where the image can be directly downloaded. A custom image must be in either `.iso` or `.qcow2` format. Other formats will be rejected. Please note that downloading can take a while depending on network speed resp. bandwidth and size of image. You can check the status by retrieving information about the image via a GET request. Download will be rejected if you have exceeded your limits. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_custom_image_request: (required) + :type create_custom_image_request: CreateCustomImageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_image_serialize( + x_request_id=x_request_id, + create_custom_image_request=create_custom_image_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCustomImageResponse", + '415': "CreateCustomImageFailResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_custom_image_serialize( self, x_request_id, create_custom_image_request, - **kwargs - ): - """Provide a custom image # noqa: E501 - - In order to provide a custom image please specify an URL from where the image can be directly downloaded. A custom image must be in either `.iso` or `.qcow2` format. Other formats will be rejected. Please note that downloading can take a while depending on network speed resp. bandwidth and size of image. You can check the status by retrieving information about the image via a GET request. Download will be rejected if you have exceeded your limits. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_custom_image(x_request_id, create_custom_image_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_custom_image_request (CreateCustomImageRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateCustomImageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_custom_image_request'] = \ - create_custom_image_request - return self.create_custom_image_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_custom_image_request is not None: + _body_params = create_custom_image_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/images', + 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_image( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete an uploaded custom image by its id + + Your are free to delete a previously uploaded custom images at any time + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_image_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete an uploaded custom image by its id + + Your are free to delete a previously uploaded custom images at any time + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_image_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete an uploaded custom image by its id + + Your are free to delete a previously uploaded custom images at any time + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_image_serialize( self, x_request_id, image_id, - **kwargs - ): - """Delete an uploaded custom image by its id # noqa: E501 - - Your are free to delete a previously uploaded custom images at any time # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_image(x_request_id, image_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - image_id (str): The identifier of the image - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['image_id'] = \ - image_id - return self.delete_image_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if image_id is not None: + _path_params['imageId'] = image_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/compute/images/{imageId}', + 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 retrieve_custom_images_stats( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CustomImagesStatsResponse: + """List statistics regarding the customer's custom images + + List statistics regarding the customer's custom images such as the number of custom images uploaded, used disk space, free available disk space and total available disk space + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_custom_images_stats_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomImagesStatsResponse", + } + 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 retrieve_custom_images_stats_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CustomImagesStatsResponse]: + """List statistics regarding the customer's custom images + + List statistics regarding the customer's custom images such as the number of custom images uploaded, used disk space, free available disk space and total available disk space + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_custom_images_stats_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomImagesStatsResponse", + } + 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 retrieve_custom_images_stats_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 statistics regarding the customer's custom images + + List statistics regarding the customer's custom images such as the number of custom images uploaded, used disk space, free available disk space and total available disk space + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_custom_images_stats_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CustomImagesStatsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_custom_images_stats_serialize( self, x_request_id, - **kwargs - ): - """List statistics regarding the customer's custom images # noqa: E501 - - List statistics regarding the customer's custom images such as the number of custom images uploaded, used disk space, free available disk space and total available disk space # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_custom_images_stats(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CustomImagesStatsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_custom_images_stats_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/images/stats', + 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 retrieve_image( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindImageResponse: + """Get details about a specific image by its id + + Get details about a specific image. This could be either a standard or custom image. In case of an custom image you can also check the download status + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindImageResponse", + } + 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 retrieve_image_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindImageResponse]: + """Get details about a specific image by its id + + Get details about a specific image. This could be either a standard or custom image. In case of an custom image you can also check the download status + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindImageResponse", + } + 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 retrieve_image_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 details about a specific image by its id + + Get details about a specific image. This could be either a standard or custom image. In case of an custom image you can also check the download status + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindImageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_image_serialize( self, x_request_id, image_id, - **kwargs - ): - """Get details about a specific image by its id # noqa: E501 - - Get details about a specific image. This could be either a standard or custom image. In case of an custom image you can also check the download status # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_image(x_request_id, image_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - image_id (str): The identifier of the image - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindImageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['image_id'] = \ - image_id - return self.retrieve_image_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if image_id is not None: + _path_params['imageId'] = image_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/images/{imageId}', + 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 retrieve_image_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the image")] = None, + standard_image: Annotated[Optional[StrictBool], Field(description="Flag indicating that image is either a standard (true) or a custom image (false)")] = 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, + ) -> ListImageResponse: + """List available standard and custom images + + List and filter all available standard images provided by [Contabo](https://contabo.com) and your uploaded custom images. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the image + :type name: str + :param standard_image: Flag indicating that image is either a standard (true) or a custom image (false) + :type standard_image: 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._retrieve_image_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + standard_image=standard_image, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListImageResponse", + } + 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 retrieve_image_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the image")] = None, + standard_image: Annotated[Optional[StrictBool], Field(description="Flag indicating that image is either a standard (true) or a custom image (false)")] = 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[ListImageResponse]: + """List available standard and custom images + + List and filter all available standard images provided by [Contabo](https://contabo.com) and your uploaded custom images. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the image + :type name: str + :param standard_image: Flag indicating that image is either a standard (true) or a custom image (false) + :type standard_image: 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._retrieve_image_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + standard_image=standard_image, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListImageResponse", + } + 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 retrieve_image_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the image")] = None, + standard_image: Annotated[Optional[StrictBool], Field(description="Flag indicating that image is either a standard (true) or a custom image (false)")] = 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 available standard and custom images + + List and filter all available standard images provided by [Contabo](https://contabo.com) and your uploaded custom images. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the image + :type name: str + :param standard_image: Flag indicating that image is either a standard (true) or a custom image (false) + :type standard_image: 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._retrieve_image_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + standard_image=standard_image, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListImageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_image_list_serialize( self, x_request_id, - **kwargs - ): - """List available standard and custom images # noqa: E501 - - List and filter all available standard images provided by [Contabo](https://contabo.com) and your uploaded custom images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_image_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - name (str): The name of the image. [optional] - standard_image (bool): Flag indicating that image is either a standard (true) or a custom image (false). [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListImageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_image_list_endpoint.call_with_http_info(**kwargs) + x_trace_id, + page, + size, + order_by, + name, + standard_image, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if name is not None: + + _query_params.append(('name', name)) + + if standard_image is not None: + + _query_params.append(('standardImage', standard_image)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/images', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def update_image( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + update_custom_image_request: UpdateCustomImageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UpdateCustomImageResponse: + """Update custom image name by its id + + Update name of the custom image + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param update_custom_image_request: (required) + :type update_custom_image_request: UpdateCustomImageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + update_custom_image_request=update_custom_image_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateCustomImageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_image_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + update_custom_image_request: UpdateCustomImageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UpdateCustomImageResponse]: + """Update custom image name by its id + + Update name of the custom image + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param update_custom_image_request: (required) + :type update_custom_image_request: UpdateCustomImageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + update_custom_image_request=update_custom_image_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateCustomImageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_image_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + image_id: Annotated[StrictStr, Field(description="The identifier of the image")], + update_custom_image_request: UpdateCustomImageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update custom image name by its id + + Update name of the custom image + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param image_id: The identifier of the image (required) + :type image_id: str + :param update_custom_image_request: (required) + :type update_custom_image_request: UpdateCustomImageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_image_serialize( + x_request_id=x_request_id, + image_id=image_id, + update_custom_image_request=update_custom_image_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateCustomImageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_image_serialize( self, x_request_id, image_id, update_custom_image_request, - **kwargs - ): - """Update custom image name by its id # noqa: E501 - - Update name of the custom image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_image(x_request_id, image_id, update_custom_image_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - image_id (str): The identifier of the image - update_custom_image_request (UpdateCustomImageRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UpdateCustomImageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['image_id'] = \ - image_id - kwargs['update_custom_image_request'] = \ - update_custom_image_request - return self.update_image_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if image_id is not None: + _path_params['imageId'] = image_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if update_custom_image_request is not None: + _body_params = update_custom_image_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/compute/images/{imageId}', + 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/pfruck_contabo/api/images_audits_api.py b/pfruck_contabo/api/images_audits_api.py index 9e182ca..018c645 100644 --- a/pfruck_contabo/api/images_audits_api.py +++ b/pfruck_contabo/api/images_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.image_audit_response import ImageAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.image_audit_response import ImageAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class ImagesAuditsApi(object): +class ImagesAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_image_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ImageAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/images/audits', - 'operation_id': 'retrieve_image_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'image_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'image_id': - (str,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'image_id': 'imageId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'image_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_image_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your custom images (audit) # noqa: E501 - - List and filters the history about your custom images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_image_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - image_id (str): The identifier of the image.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): UserId of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ImageAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + image_id: Annotated[Optional[StrictStr], Field(description="The identifier of the image.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ImageAuditResponse: + """List history about your custom images (audit) + + List and filters the history about your custom images. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param image_id: The identifier of the image. + :type image_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_image_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + image_id=image_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_image_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + image_id: Annotated[Optional[StrictStr], Field(description="The identifier of the image.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ImageAuditResponse]: + """List history about your custom images (audit) + + List and filters the history about your custom images. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param image_id: The identifier of the image. + :type image_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_image_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + image_id=image_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_image_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + image_id: Annotated[Optional[StrictStr], Field(description="The identifier of the image.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your custom images (audit) + + List and filters the history about your custom images. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param image_id: The identifier of the image. + :type image_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_image_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + image_id=image_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_image_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + image_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if image_id is not None: + + _query_params.append(('imageId', image_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/images/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_image_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/instance_actions_api.py b/pfruck_contabo/api/instance_actions_api.py index 9558c24..1b6e88e 100644 --- a/pfruck_contabo/api/instance_actions_api.py +++ b/pfruck_contabo/api/instance_actions_api.py @@ -1,1009 +1,1830 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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, field_validator +from typing import Optional +from typing_extensions import Annotated +from pfruck_contabo.models.instance_rescue_action_response import InstanceRescueActionResponse +from pfruck_contabo.models.instance_reset_password_action_response import InstanceResetPasswordActionResponse +from pfruck_contabo.models.instance_restart_action_response import InstanceRestartActionResponse +from pfruck_contabo.models.instance_shutdown_action_response import InstanceShutdownActionResponse +from pfruck_contabo.models.instance_start_action_response import InstanceStartActionResponse +from pfruck_contabo.models.instance_stop_action_response import InstanceStopActionResponse +from pfruck_contabo.models.instances_actions_rescue_request import InstancesActionsRescueRequest +from pfruck_contabo.models.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.instance_rescue_action_response import InstanceRescueActionResponse -from pfruck_contabo.model.instance_reset_password_action_response import InstanceResetPasswordActionResponse -from pfruck_contabo.model.instance_restart_action_response import InstanceRestartActionResponse -from pfruck_contabo.model.instance_shutdown_action_response import InstanceShutdownActionResponse -from pfruck_contabo.model.instance_start_action_response import InstanceStartActionResponse -from pfruck_contabo.model.instance_stop_action_response import InstanceStopActionResponse -from pfruck_contabo.model.instances_actions_rescue_request import InstancesActionsRescueRequest -from pfruck_contabo.model.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest - - -class InstanceActionsApi(object): +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class InstanceActionsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.rescue_endpoint = _Endpoint( - settings={ - 'response_type': (InstanceRescueActionResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/actions/rescue', - 'operation_id': 'rescue', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'instances_actions_rescue_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'instances_actions_rescue_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'instances_actions_rescue_request': - (InstancesActionsRescueRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'instances_actions_rescue_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.reset_password_action_endpoint = _Endpoint( - settings={ - 'response_type': (InstanceResetPasswordActionResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/actions/resetPassword', - 'operation_id': 'reset_password_action', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'instances_reset_password_actions_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'instances_reset_password_actions_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'instances_reset_password_actions_request': - (InstancesResetPasswordActionsRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'instances_reset_password_actions_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.restart_endpoint = _Endpoint( - settings={ - 'response_type': (InstanceRestartActionResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/actions/restart', - 'operation_id': 'restart', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.shutdown_endpoint = _Endpoint( - settings={ - 'response_type': (InstanceShutdownActionResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/actions/shutdown', - 'operation_id': 'shutdown', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.start_endpoint = _Endpoint( - settings={ - 'response_type': (InstanceStartActionResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/actions/start', - 'operation_id': 'start', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.stop_endpoint = _Endpoint( - settings={ - 'response_type': (InstanceStopActionResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/actions/stop', - 'operation_id': 'stop', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def rescue( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + instances_actions_rescue_request: InstancesActionsRescueRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> InstanceRescueActionResponse: + """Rescue a compute instance / resource identified by its id + + You can reboot your instance in rescue mode to resolve system issues. Rescue system is Linux based and its booted instead of your regular operating system. The disk containing your operating sytstem, software and your data is already mounted for you to access and repair/modify files. After a reboot your compute instance will boot your operating system. Please note that this is for advanced users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param instances_actions_rescue_request: (required) + :type instances_actions_rescue_request: InstancesActionsRescueRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rescue_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + instances_actions_rescue_request=instances_actions_rescue_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceRescueActionResponse", + } + 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 rescue_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + instances_actions_rescue_request: InstancesActionsRescueRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[InstanceRescueActionResponse]: + """Rescue a compute instance / resource identified by its id + + You can reboot your instance in rescue mode to resolve system issues. Rescue system is Linux based and its booted instead of your regular operating system. The disk containing your operating sytstem, software and your data is already mounted for you to access and repair/modify files. After a reboot your compute instance will boot your operating system. Please note that this is for advanced users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param instances_actions_rescue_request: (required) + :type instances_actions_rescue_request: InstancesActionsRescueRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rescue_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + instances_actions_rescue_request=instances_actions_rescue_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceRescueActionResponse", + } + 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 rescue_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + instances_actions_rescue_request: InstancesActionsRescueRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Rescue a compute instance / resource identified by its id + + You can reboot your instance in rescue mode to resolve system issues. Rescue system is Linux based and its booted instead of your regular operating system. The disk containing your operating sytstem, software and your data is already mounted for you to access and repair/modify files. After a reboot your compute instance will boot your operating system. Please note that this is for advanced users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param instances_actions_rescue_request: (required) + :type instances_actions_rescue_request: InstancesActionsRescueRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rescue_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + instances_actions_rescue_request=instances_actions_rescue_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceRescueActionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rescue_serialize( self, x_request_id, instance_id, instances_actions_rescue_request, - **kwargs - ): - """Rescue a compute instance / resource identified by its id # noqa: E501 - - You can reboot your instance in rescue mode to resolve system issues. Rescue system is Linux based and its booted instead of your regular operating system. The disk containing your operating sytstem, software and your data is already mounted for you to access and repair/modify files. After a reboot your compute instance will boot your operating system. Please note that this is for advanced users. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.rescue(x_request_id, instance_id, instances_actions_rescue_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the compute instance / resource to be started in rescue mode. - instances_actions_rescue_request (InstancesActionsRescueRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - InstanceRescueActionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['instances_actions_rescue_request'] = \ - instances_actions_rescue_request - return self.rescue_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if instances_actions_rescue_request is not None: + _body_params = instances_actions_rescue_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/actions/rescue', + 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 reset_password_action( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + instances_reset_password_actions_request: InstancesResetPasswordActionsRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> InstanceResetPasswordActionResponse: + """Reset password for a compute instance / resource referenced by an id + + Reset password for a compute instance / resource referenced by an id. This will reset the current password to the password that you provided in the body of this request. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param instances_reset_password_actions_request: (required) + :type instances_reset_password_actions_request: InstancesResetPasswordActionsRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_password_action_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + instances_reset_password_actions_request=instances_reset_password_actions_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceResetPasswordActionResponse", + } + 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 reset_password_action_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + instances_reset_password_actions_request: InstancesResetPasswordActionsRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[InstanceResetPasswordActionResponse]: + """Reset password for a compute instance / resource referenced by an id + + Reset password for a compute instance / resource referenced by an id. This will reset the current password to the password that you provided in the body of this request. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param instances_reset_password_actions_request: (required) + :type instances_reset_password_actions_request: InstancesResetPasswordActionsRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_password_action_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + instances_reset_password_actions_request=instances_reset_password_actions_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceResetPasswordActionResponse", + } + 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 reset_password_action_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + instances_reset_password_actions_request: InstancesResetPasswordActionsRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Reset password for a compute instance / resource referenced by an id + + Reset password for a compute instance / resource referenced by an id. This will reset the current password to the password that you provided in the body of this request. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param instances_reset_password_actions_request: (required) + :type instances_reset_password_actions_request: InstancesResetPasswordActionsRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reset_password_action_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + instances_reset_password_actions_request=instances_reset_password_actions_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceResetPasswordActionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _reset_password_action_serialize( self, x_request_id, instance_id, instances_reset_password_actions_request, - **kwargs - ): - """Reset password for a compute instance / resource referenced by an id # noqa: E501 - - Reset password for a compute instance / resource referenced by an id. This will reset the current password to the password that you provided in the body of this request. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.reset_password_action(x_request_id, instance_id, instances_reset_password_actions_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the compute instance / resource to be started in rescue mode. - instances_reset_password_actions_request (InstancesResetPasswordActionsRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - InstanceResetPasswordActionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['instances_reset_password_actions_request'] = \ - instances_reset_password_actions_request - return self.reset_password_action_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if instances_reset_password_actions_request is not None: + _body_params = instances_reset_password_actions_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/actions/resetPassword', + 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 restart( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> InstanceRestartActionResponse: + """Restart a compute instance / resource identified by its id. + + To restart a compute instance that has been identified by its id, you should perform a restart action on it. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restart_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceRestartActionResponse", + } + 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 restart_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[InstanceRestartActionResponse]: + """Restart a compute instance / resource identified by its id. + + To restart a compute instance that has been identified by its id, you should perform a restart action on it. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restart_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceRestartActionResponse", + } + 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 restart_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Restart a compute instance / resource identified by its id. + + To restart a compute instance that has been identified by its id, you should perform a restart action on it. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restart_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceRestartActionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _restart_serialize( self, x_request_id, instance_id, - **kwargs - ): - """Restart a compute instance / resource identified by its id. # noqa: E501 - - To restart a compute instance that has been identified by its id, you should perform a restart action on it. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.restart(x_request_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the compute instance / resource to be started in rescue mode. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - InstanceRestartActionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - return self.restart_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/actions/restart', + 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 shutdown( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> InstanceShutdownActionResponse: + """Shutdown compute instance / resource by its id + + Shutdown an compute instance / resource. This is similar to pressing the power button on a physical machine. This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shutdown_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceShutdownActionResponse", + } + 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 shutdown_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[InstanceShutdownActionResponse]: + """Shutdown compute instance / resource by its id + + Shutdown an compute instance / resource. This is similar to pressing the power button on a physical machine. This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shutdown_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceShutdownActionResponse", + } + 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 shutdown_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Shutdown compute instance / resource by its id + + Shutdown an compute instance / resource. This is similar to pressing the power button on a physical machine. This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._shutdown_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceShutdownActionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _shutdown_serialize( self, x_request_id, instance_id, - **kwargs - ): - """Shutdown compute instance / resource by its id # noqa: E501 - - Shutdown an compute instance / resource. This is similar to pressing the power button on a physical machine. This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.shutdown(x_request_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the compute instance / resource to be started in rescue mode. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - InstanceShutdownActionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - return self.shutdown_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/actions/shutdown', + 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 start( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> InstanceStartActionResponse: + """Start a compute instance / resource identified by its id + + Starting a compute instance / resource is like powering on a real server. If the compute instance / resource is already started nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceStartActionResponse", + } + 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 start_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[InstanceStartActionResponse]: + """Start a compute instance / resource identified by its id + + Starting a compute instance / resource is like powering on a real server. If the compute instance / resource is already started nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceStartActionResponse", + } + 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 start_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Start a compute instance / resource identified by its id + + Starting a compute instance / resource is like powering on a real server. If the compute instance / resource is already started nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceStartActionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _start_serialize( self, x_request_id, instance_id, - **kwargs - ): - """Start a compute instance / resource identified by its id # noqa: E501 - - Starting a compute instance / resource is like powering on a real server. If the compute instance / resource is already started nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.start(x_request_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the compute instance / resource to be started in rescue mode. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - InstanceStartActionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - return self.start_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/actions/start', + 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 stop( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> InstanceStopActionResponse: + """Stop compute instance / resource by its id + + Stopping a compute instance / resource is like powering off a real server. So please be aware that data may be lost. Alternatively you may log in and shut your compute instance / resource gracefully via the operating system. If the compute instance / resource is already stopped nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceStopActionResponse", + } + 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 stop_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[InstanceStopActionResponse]: + """Stop compute instance / resource by its id + + Stopping a compute instance / resource is like powering off a real server. So please be aware that data may be lost. Alternatively you may log in and shut your compute instance / resource gracefully via the operating system. If the compute instance / resource is already stopped nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceStopActionResponse", + } + 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 stop_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the compute instance / resource to be started in rescue mode.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Stop compute instance / resource by its id + + Stopping a compute instance / resource is like powering off a real server. So please be aware that data may be lost. Alternatively you may log in and shut your compute instance / resource gracefully via the operating system. If the compute instance / resource is already stopped nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the compute instance / resource to be started in rescue mode. (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "InstanceStopActionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stop_serialize( self, x_request_id, instance_id, - **kwargs - ): - """Stop compute instance / resource by its id # noqa: E501 - - Stopping a compute instance / resource is like powering off a real server. So please be aware that data may be lost. Alternatively you may log in and shut your compute instance / resource gracefully via the operating system. If the compute instance / resource is already stopped nothing will happen. You may check the current status anytime when getting information about a compute instance / resource. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.stop(x_request_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the compute instance / resource to be started in rescue mode. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - InstanceStopActionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - return self.stop_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/actions/stop', + 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/pfruck_contabo/api/instance_actions_audits_api.py b/pfruck_contabo/api/instance_actions_audits_api.py index 44101b0..fc408e2 100644 --- a/pfruck_contabo/api/instance_actions_audits_api.py +++ b/pfruck_contabo/api/instance_actions_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_instances_actions_audit_response import ListInstancesActionsAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_instances_actions_audit_response import ListInstancesActionsAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class InstanceActionsAuditsApi(object): +class InstanceActionsAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_instances_actions_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListInstancesActionsAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/actions/audits', - 'operation_id': 'retrieve_instances_actions_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'instance_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'instance_id': - (int,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'instance_id': 'instanceId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'instance_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_instances_actions_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your actions (audit) triggered via the API # noqa: E501 - - List and filters the history about your actions your triggered via the API. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_instances_actions_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - instance_id (int): The identifier of the instancesActions.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): changedBy of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListInstancesActionsAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instancesActions.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListInstancesActionsAuditResponse: + """List history about your actions (audit) triggered via the API + + List and filters the history about your actions your triggered via the API. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instancesActions. + :type instance_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_instances_actions_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesActionsAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_instances_actions_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instancesActions.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListInstancesActionsAuditResponse]: + """List history about your actions (audit) triggered via the API + + List and filters the history about your actions your triggered via the API. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instancesActions. + :type instance_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_instances_actions_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesActionsAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_instances_actions_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instancesActions.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your actions (audit) triggered via the API + + List and filters the history about your actions your triggered via the API. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instancesActions. + :type instance_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_instances_actions_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesActionsAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_instances_actions_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + instance_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if instance_id is not None: + + _query_params.append(('instanceId', instance_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/instances/actions/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_instances_actions_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/instances_api.py b/pfruck_contabo/api/instances_api.py index 3f04806..654754e 100644 --- a/pfruck_contabo/api/instances_api.py +++ b/pfruck_contabo/api/instances_api.py @@ -1,1266 +1,2368 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.cancel_instance_response import CancelInstanceResponse +from pfruck_contabo.models.create_instance_request import CreateInstanceRequest +from pfruck_contabo.models.create_instance_response import CreateInstanceResponse +from pfruck_contabo.models.find_instance_response import FindInstanceResponse +from pfruck_contabo.models.list_instances_response import ListInstancesResponse +from pfruck_contabo.models.patch_instance_request import PatchInstanceRequest +from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse +from pfruck_contabo.models.reinstall_instance_request import ReinstallInstanceRequest +from pfruck_contabo.models.reinstall_instance_response import ReinstallInstanceResponse +from pfruck_contabo.models.upgrade_instance_request import UpgradeInstanceRequest -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.cancel_instance_response import CancelInstanceResponse -from pfruck_contabo.model.create_instance_request import CreateInstanceRequest -from pfruck_contabo.model.create_instance_response import CreateInstanceResponse -from pfruck_contabo.model.find_instance_response import FindInstanceResponse -from pfruck_contabo.model.list_instances_response import ListInstancesResponse -from pfruck_contabo.model.patch_instance_request import PatchInstanceRequest -from pfruck_contabo.model.patch_instance_response import PatchInstanceResponse -from pfruck_contabo.model.reinstall_instance_request import ReinstallInstanceRequest -from pfruck_contabo.model.reinstall_instance_response import ReinstallInstanceResponse -from pfruck_contabo.model.upgrade_instance_request import UpgradeInstanceRequest - - -class InstancesApi(object): +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class InstancesApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.cancel_instance_endpoint = _Endpoint( - settings={ - 'response_type': (CancelInstanceResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/cancel', - 'operation_id': 'cancel_instance', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def cancel_instance( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CancelInstanceResponse: + """Cancel specific instance by id + + Your are free to cancel a previously created instance at any time. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.create_instance_endpoint = _Endpoint( - settings={ - 'response_type': (CreateInstanceResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances', - 'operation_id': 'create_instance', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_instance_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_instance_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_instance_request': - (CreateInstanceRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_instance_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CancelInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.patch_instance_endpoint = _Endpoint( - settings={ - 'response_type': (PatchInstanceResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}', - 'operation_id': 'patch_instance', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'patch_instance_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'patch_instance_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'patch_instance_request': - (PatchInstanceRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'patch_instance_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def cancel_instance_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CancelInstanceResponse]: + """Cancel specific instance by id + + Your are free to cancel a previously created instance at any time. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.reinstall_instance_endpoint = _Endpoint( - settings={ - 'response_type': (ReinstallInstanceResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}', - 'operation_id': 'reinstall_instance', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'reinstall_instance_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'reinstall_instance_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'reinstall_instance_request': - (ReinstallInstanceRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'reinstall_instance_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CancelInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.retrieve_instance_endpoint = _Endpoint( - settings={ - 'response_type': (FindInstanceResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}', - 'operation_id': 'retrieve_instance', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.retrieve_instances_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListInstancesResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances', - 'operation_id': 'retrieve_instances_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'name', - 'display_name', - 'data_center', - 'region', - 'instance_id', - 'instance_ids', - 'status', - 'add_on_ids', - 'product_types', - 'ip_config', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - ('status',): { - - "PROVISIONING": "provisioning", - "UNINSTALLED": "uninstalled", - "RUNNING": "running", - "STOPPED": "stopped", - "ERROR": "error", - "INSTALLING": "installing", - "UNKNOWN": "unknown", - "MANUAL_PROVISIONING": "manual_provisioning", - "PRODUCT_NOT_AVAILABLE": "product_not_available", - "VERIFICATION_REQUIRED": "verification_required", - "RESCUE": "rescue", - "PENDING_PAYMENT": "pending_payment", - "OTHER": "other" - }, - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'name': - (str,), - 'display_name': - (str,), - 'data_center': - (str,), - 'region': - (str,), - 'instance_id': - (int,), - 'instance_ids': - (str,), - 'status': - (str,), - 'add_on_ids': - (str,), - 'product_types': - (str,), - 'ip_config': - (bool,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'name': 'name', - 'display_name': 'displayName', - 'data_center': 'dataCenter', - 'region': 'region', - 'instance_id': 'instanceId', - 'instance_ids': 'instanceIds', - 'status': 'status', - 'add_on_ids': 'addOnIds', - 'product_types': 'productTypes', - 'ip_config': 'ipConfig', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'name': 'query', - 'display_name': 'query', - 'data_center': 'query', - 'region': 'query', - 'instance_id': 'query', - 'instance_ids': 'query', - 'status': 'query', - 'add_on_ids': 'query', - 'product_types': 'query', - 'ip_config': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def cancel_instance_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Cancel specific instance by id + + Your are free to cancel a previously created instance at any time. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.upgrade_instance_endpoint = _Endpoint( - settings={ - 'response_type': (PatchInstanceResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/upgrade', - 'operation_id': 'upgrade_instance', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'upgrade_instance_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'upgrade_instance_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'upgrade_instance_request': - (UpgradeInstanceRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'upgrade_instance_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CancelInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - def cancel_instance( + + def _cancel_instance_serialize( self, x_request_id, instance_id, - **kwargs - ): - """Cancel specific instance by id # noqa: E501 - - Your are free to cancel a previously created instance at any time. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.cancel_instance(x_request_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CancelInstanceResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/cancel', + 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_instance( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_instance_request: CreateInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateInstanceResponse: + """Create a new instance + + Create a new instance for your account with the provided parameters.
ProductIdProductDisk Size
V45VPS 1 SSD400 GB SSD
V47VPS 1 Storage800 GB SSD
V46VPS 1 NVMe100 GB NVMe
V48VPS 2 SSD400 GB SSD
V50VPS 2 Storage800 GB SSD
V49VPS 2 NVMe200 GB NVMe
V51VPS 3 SSD1200 GB SSD
V53VPS 3 Storage2400 GB SSD
V52VPS 3 NVMe300 GB NVMe
V54VPS 4 SSD1600 GB SSD
V56VPS 4 Storage3200 GB SSD
V55VPS 4 NVMe400 GB NVMe
V57VPS 5 SSD2000 GB SSD
V59VPS 5 Storage4000 GB SSD
V58VPS 5 NVMe500 GB NVMe
V60VPS 6 SSD2400 GB SSD
V62VPS 6 Storage4800 GB SSD
V61VPS 6 NVMe600 GB NVMe
V8VDS S180 GB NVMe
V9VDS M240 GB NVMe
V10VDS L360 GB NVMe
V11VDS XL480 GB NVMe
V16VDS XXL720 GB NVMe
+ + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_instance_request: (required) + :type create_instance_request: CreateInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_serialize( + x_request_id=x_request_id, + create_instance_request=create_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_instance_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_instance_request: CreateInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateInstanceResponse]: + """Create a new instance + + Create a new instance for your account with the provided parameters.
ProductIdProductDisk Size
V45VPS 1 SSD400 GB SSD
V47VPS 1 Storage800 GB SSD
V46VPS 1 NVMe100 GB NVMe
V48VPS 2 SSD400 GB SSD
V50VPS 2 Storage800 GB SSD
V49VPS 2 NVMe200 GB NVMe
V51VPS 3 SSD1200 GB SSD
V53VPS 3 Storage2400 GB SSD
V52VPS 3 NVMe300 GB NVMe
V54VPS 4 SSD1600 GB SSD
V56VPS 4 Storage3200 GB SSD
V55VPS 4 NVMe400 GB NVMe
V57VPS 5 SSD2000 GB SSD
V59VPS 5 Storage4000 GB SSD
V58VPS 5 NVMe500 GB NVMe
V60VPS 6 SSD2400 GB SSD
V62VPS 6 Storage4800 GB SSD
V61VPS 6 NVMe600 GB NVMe
V8VDS S180 GB NVMe
V9VDS M240 GB NVMe
V10VDS L360 GB NVMe
V11VDS XL480 GB NVMe
V16VDS XXL720 GB NVMe
+ + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_instance_request: (required) + :type create_instance_request: CreateInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_serialize( + x_request_id=x_request_id, + create_instance_request=create_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def create_instance_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_instance_request: CreateInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new instance + + Create a new instance for your account with the provided parameters.
ProductIdProductDisk Size
V45VPS 1 SSD400 GB SSD
V47VPS 1 Storage800 GB SSD
V46VPS 1 NVMe100 GB NVMe
V48VPS 2 SSD400 GB SSD
V50VPS 2 Storage800 GB SSD
V49VPS 2 NVMe200 GB NVMe
V51VPS 3 SSD1200 GB SSD
V53VPS 3 Storage2400 GB SSD
V52VPS 3 NVMe300 GB NVMe
V54VPS 4 SSD1600 GB SSD
V56VPS 4 Storage3200 GB SSD
V55VPS 4 NVMe400 GB NVMe
V57VPS 5 SSD2000 GB SSD
V59VPS 5 Storage4000 GB SSD
V58VPS 5 NVMe500 GB NVMe
V60VPS 6 SSD2400 GB SSD
V62VPS 6 Storage4800 GB SSD
V61VPS 6 NVMe600 GB NVMe
V8VDS S180 GB NVMe
V9VDS M240 GB NVMe
V10VDS L360 GB NVMe
V11VDS XL480 GB NVMe
V16VDS XXL720 GB NVMe
+ + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_instance_request: (required) + :type create_instance_request: CreateInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_instance_serialize( + x_request_id=x_request_id, + create_instance_request=create_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - return self.cancel_instance_endpoint.call_with_http_info(**kwargs) + return response_data.response - def create_instance( + + def _create_instance_serialize( self, x_request_id, create_instance_request, - **kwargs - ): - """Create a new instance # noqa: E501 - - Create a new instance for your account with the provided parameters.
ProductIdProductDisk Size
V45VPS 1 SSD400 GB SSD
V47VPS 1 Storage800 GB SSD
V46VPS 1 NVMe100 GB NVMe
V48VPS 2 SSD400 GB SSD
V50VPS 2 Storage800 GB SSD
V49VPS 2 NVMe200 GB NVMe
V51VPS 3 SSD1200 GB SSD
V53VPS 3 Storage2400 GB SSD
V52VPS 3 NVMe300 GB NVMe
V54VPS 4 SSD1600 GB SSD
V56VPS 4 Storage3200 GB SSD
V55VPS 4 NVMe400 GB NVMe
V57VPS 5 SSD2000 GB SSD
V59VPS 5 Storage4000 GB SSD
V58VPS 5 NVMe500 GB NVMe
V60VPS 6 SSD2400 GB SSD
V62VPS 6 Storage4800 GB SSD
V61VPS 6 NVMe600 GB NVMe
V8VDS S180 GB NVMe
V9VDS M240 GB NVMe
V10VDS L360 GB NVMe
V11VDS XL480 GB NVMe
V16VDS XXL720 GB NVMe
# noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_instance(x_request_id, create_instance_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_instance_request (CreateInstanceRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateInstanceResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_instance_request is not None: + _body_params = create_instance_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def patch_instance( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + patch_instance_request: PatchInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> PatchInstanceResponse: + """Update specific instance + + Update specific instance by instanceId. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param patch_instance_request: (required) + :type patch_instance_request: PatchInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + patch_instance_request=patch_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def patch_instance_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + patch_instance_request: PatchInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[PatchInstanceResponse]: + """Update specific instance + + Update specific instance by instanceId. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param patch_instance_request: (required) + :type patch_instance_request: PatchInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + patch_instance_request=patch_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_instance_request'] = \ - create_instance_request - return self.create_instance_endpoint.call_with_http_info(**kwargs) - def patch_instance( + + @validate_call + def patch_instance_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + patch_instance_request: PatchInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update specific instance + + Update specific instance by instanceId. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param patch_instance_request: (required) + :type patch_instance_request: PatchInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + patch_instance_request=patch_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _patch_instance_serialize( self, x_request_id, instance_id, patch_instance_request, - **kwargs - ): - """Update specific instance # noqa: E501 - - Update specific instance by instanceId. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.patch_instance(x_request_id, instance_id, patch_instance_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - patch_instance_request (PatchInstanceRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PatchInstanceResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if patch_instance_request is not None: + _body_params = patch_instance_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/compute/instances/{instanceId}', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def reinstall_instance( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + reinstall_instance_request: ReinstallInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> ReinstallInstanceResponse: + """Reinstall specific instance + + You can reinstall a specific instance with a new image and optionally add ssh keys, a root password or cloud-init. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param reinstall_instance_request: (required) + :type reinstall_instance_request: ReinstallInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reinstall_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + reinstall_instance_request=reinstall_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReinstallInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def reinstall_instance_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + reinstall_instance_request: ReinstallInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[ReinstallInstanceResponse]: + """Reinstall specific instance + + You can reinstall a specific instance with a new image and optionally add ssh keys, a root password or cloud-init. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param reinstall_instance_request: (required) + :type reinstall_instance_request: ReinstallInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reinstall_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + reinstall_instance_request=reinstall_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReinstallInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['patch_instance_request'] = \ - patch_instance_request - return self.patch_instance_endpoint.call_with_http_info(**kwargs) - def reinstall_instance( + + @validate_call + def reinstall_instance_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + reinstall_instance_request: ReinstallInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Reinstall specific instance + + You can reinstall a specific instance with a new image and optionally add ssh keys, a root password or cloud-init. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param reinstall_instance_request: (required) + :type reinstall_instance_request: ReinstallInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._reinstall_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + reinstall_instance_request=reinstall_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReinstallInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _reinstall_instance_serialize( self, x_request_id, instance_id, reinstall_instance_request, - **kwargs - ): - """Reinstall specific instance # noqa: E501 - - You can reinstall a specific instance with a new image and optionally add ssh keys, a root password or cloud-init. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.reinstall_instance(x_request_id, instance_id, reinstall_instance_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - reinstall_instance_request (ReinstallInstanceRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ReinstallInstanceResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if reinstall_instance_request is not None: + _body_params = reinstall_instance_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/compute/instances/{instanceId}', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def retrieve_instance( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindInstanceResponse: + """Get specific instance by id + + Get attributes values to a specific instance on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_instance_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindInstanceResponse]: + """Get specific instance by id + + Get attributes values to a specific instance on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['reinstall_instance_request'] = \ - reinstall_instance_request - return self.reinstall_instance_endpoint.call_with_http_info(**kwargs) - def retrieve_instance( + + @validate_call + def retrieve_instance_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific instance by id + + Get attributes values to a specific instance on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_instance_serialize( self, x_request_id, instance_id, - **kwargs - ): - """Get specific instance by id # noqa: E501 - - Get attributes values to a specific instance on your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_instance(x_request_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindInstanceResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/instances/{instanceId}', + 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 retrieve_instances_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the instance")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="The display name of the instance")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The data center of the instance")] = None, + region: Annotated[Optional[StrictStr], Field(description="The Region of the instance")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instance (deprecated)")] = None, + instance_ids: Annotated[Optional[StrictStr], Field(description="Comma separated instances identifiers")] = None, + status: Annotated[Optional[StrictStr], Field(description="The status of the instance")] = None, + add_on_ids: Annotated[Optional[StrictStr], Field(description="Identifiers of Addons the instances have")] = None, + product_types: Annotated[Optional[StrictStr], Field(description="Comma separated instance's category depending on Product Id")] = None, + ip_config: Annotated[Optional[StrictBool], Field(description="Filter instances that have an ip config")] = 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, + ) -> ListInstancesResponse: + """List instances + + List and filter all instances in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the instance + :type name: str + :param display_name: The display name of the instance + :type display_name: str + :param data_center: The data center of the instance + :type data_center: str + :param region: The Region of the instance + :type region: str + :param instance_id: The identifier of the instance (deprecated) + :type instance_id: int + :param instance_ids: Comma separated instances identifiers + :type instance_ids: str + :param status: The status of the instance + :type status: str + :param add_on_ids: Identifiers of Addons the instances have + :type add_on_ids: str + :param product_types: Comma separated instance's category depending on Product Id + :type product_types: str + :param ip_config: Filter instances that have an ip config + :type ip_config: 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._retrieve_instances_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + display_name=display_name, + data_center=data_center, + region=region, + instance_id=instance_id, + instance_ids=instance_ids, + status=status, + add_on_ids=add_on_ids, + product_types=product_types, + ip_config=ip_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesResponse", + } + 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 retrieve_instances_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the instance")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="The display name of the instance")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The data center of the instance")] = None, + region: Annotated[Optional[StrictStr], Field(description="The Region of the instance")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instance (deprecated)")] = None, + instance_ids: Annotated[Optional[StrictStr], Field(description="Comma separated instances identifiers")] = None, + status: Annotated[Optional[StrictStr], Field(description="The status of the instance")] = None, + add_on_ids: Annotated[Optional[StrictStr], Field(description="Identifiers of Addons the instances have")] = None, + product_types: Annotated[Optional[StrictStr], Field(description="Comma separated instance's category depending on Product Id")] = None, + ip_config: Annotated[Optional[StrictBool], Field(description="Filter instances that have an ip config")] = 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[ListInstancesResponse]: + """List instances + + List and filter all instances in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the instance + :type name: str + :param display_name: The display name of the instance + :type display_name: str + :param data_center: The data center of the instance + :type data_center: str + :param region: The Region of the instance + :type region: str + :param instance_id: The identifier of the instance (deprecated) + :type instance_id: int + :param instance_ids: Comma separated instances identifiers + :type instance_ids: str + :param status: The status of the instance + :type status: str + :param add_on_ids: Identifiers of Addons the instances have + :type add_on_ids: str + :param product_types: Comma separated instance's category depending on Product Id + :type product_types: str + :param ip_config: Filter instances that have an ip config + :type ip_config: 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._retrieve_instances_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + display_name=display_name, + data_center=data_center, + region=region, + instance_id=instance_id, + instance_ids=instance_ids, + status=status, + add_on_ids=add_on_ids, + product_types=product_types, + ip_config=ip_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_instances_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the instance")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="The display name of the instance")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The data center of the instance")] = None, + region: Annotated[Optional[StrictStr], Field(description="The Region of the instance")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instance (deprecated)")] = None, + instance_ids: Annotated[Optional[StrictStr], Field(description="Comma separated instances identifiers")] = None, + status: Annotated[Optional[StrictStr], Field(description="The status of the instance")] = None, + add_on_ids: Annotated[Optional[StrictStr], Field(description="Identifiers of Addons the instances have")] = None, + product_types: Annotated[Optional[StrictStr], Field(description="Comma separated instance's category depending on Product Id")] = None, + ip_config: Annotated[Optional[StrictBool], Field(description="Filter instances that have an ip config")] = 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 instances + + List and filter all instances in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the instance + :type name: str + :param display_name: The display name of the instance + :type display_name: str + :param data_center: The data center of the instance + :type data_center: str + :param region: The Region of the instance + :type region: str + :param instance_id: The identifier of the instance (deprecated) + :type instance_id: int + :param instance_ids: Comma separated instances identifiers + :type instance_ids: str + :param status: The status of the instance + :type status: str + :param add_on_ids: Identifiers of Addons the instances have + :type add_on_ids: str + :param product_types: Comma separated instance's category depending on Product Id + :type product_types: str + :param ip_config: Filter instances that have an ip config + :type ip_config: 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._retrieve_instances_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + display_name=display_name, + data_center=data_center, + region=region, + instance_id=instance_id, + instance_ids=instance_ids, + status=status, + add_on_ids=add_on_ids, + product_types=product_types, + ip_config=ip_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - return self.retrieve_instance_endpoint.call_with_http_info(**kwargs) + return response_data.response - def retrieve_instances_list( + + def _retrieve_instances_list_serialize( self, x_request_id, - **kwargs - ): - """List instances # noqa: E501 - - List and filter all instances in your account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_instances_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - name (str): The name of the instance. [optional] - display_name (str): The display name of the instance. [optional] - data_center (str): The data center of the instance. [optional] - region (str): The Region of the instance. [optional] - instance_id (int): The identifier of the instance (deprecated). [optional] - instance_ids (str): Comma separated instances identifiers. [optional] - status (str): The status of the instance. [optional] - add_on_ids (str): Identifiers of Addons the instances have. [optional] - product_types (str): Comma separated instance's category depending on Product Id. [optional] - ip_config (bool): Filter instances that have an ip config. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListInstancesResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + page, + size, + order_by, + name, + display_name, + data_center, + region, + instance_id, + instance_ids, + status, + add_on_ids, + product_types, + ip_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if name is not None: + + _query_params.append(('name', name)) + + if display_name is not None: + + _query_params.append(('displayName', display_name)) + + if data_center is not None: + + _query_params.append(('dataCenter', data_center)) + + if region is not None: + + _query_params.append(('region', region)) + + if instance_id is not None: + + _query_params.append(('instanceId', instance_id)) + + if instance_ids is not None: + + _query_params.append(('instanceIds', instance_ids)) + + if status is not None: + + _query_params.append(('status', status)) + + if add_on_ids is not None: + + _query_params.append(('addOnIds', add_on_ids)) + + if product_types is not None: + + _query_params.append(('productTypes', product_types)) + + if ip_config is not None: + + _query_params.append(('ipConfig', ip_config)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/instances', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def upgrade_instance( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + upgrade_instance_request: UpgradeInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> PatchInstanceResponse: + """Upgrading instance capabilities + + In order to enhance your instance with additional features you can purchase add-ons. Currently only firewalling and private network addon is allowed. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param upgrade_instance_request: (required) + :type upgrade_instance_request: UpgradeInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upgrade_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + upgrade_instance_request=upgrade_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def upgrade_instance_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + upgrade_instance_request: UpgradeInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[PatchInstanceResponse]: + """Upgrading instance capabilities + + In order to enhance your instance with additional features you can purchase add-ons. Currently only firewalling and private network addon is allowed. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param upgrade_instance_request: (required) + :type upgrade_instance_request: UpgradeInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upgrade_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + upgrade_instance_request=upgrade_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_instances_list_endpoint.call_with_http_info(**kwargs) - def upgrade_instance( + + @validate_call + def upgrade_instance_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + upgrade_instance_request: UpgradeInstanceRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Upgrading instance capabilities + + In order to enhance your instance with additional features you can purchase add-ons. Currently only firewalling and private network addon is allowed. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param upgrade_instance_request: (required) + :type upgrade_instance_request: UpgradeInstanceRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upgrade_instance_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + upgrade_instance_request=upgrade_instance_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchInstanceResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upgrade_instance_serialize( self, x_request_id, instance_id, upgrade_instance_request, - **kwargs - ): - """Upgrading instance capabilities # noqa: E501 - - In order to enhance your instance with additional features you can purchase add-ons. Currently only firewalling and private network addon is allowed. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upgrade_instance(x_request_id, instance_id, upgrade_instance_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - upgrade_instance_request (UpgradeInstanceRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PatchInstanceResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if upgrade_instance_request is not None: + _body_params = upgrade_instance_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/upgrade', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['upgrade_instance_request'] = \ - upgrade_instance_request - return self.upgrade_instance_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/instances_audits_api.py b/pfruck_contabo/api/instances_audits_api.py index 6c0b7e8..d4ee193 100644 --- a/pfruck_contabo/api/instances_audits_api.py +++ b/pfruck_contabo/api/instances_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_instances_audit_response import ListInstancesAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_instances_audit_response import ListInstancesAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class InstancesAuditsApi(object): +class InstancesAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_instances_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListInstancesAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/audits', - 'operation_id': 'retrieve_instances_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'instance_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'instance_id': - (int,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'instance_id': 'instanceId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'instance_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_instances_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your instances (audit) # noqa: E501 - - List and filters the history about your instances. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_instances_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - instance_id (int): The identifier of the instances.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): changedBy of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListInstancesAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instances.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListInstancesAuditResponse: + """List history about your instances (audit) + + List and filters the history about your instances. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instances. + :type instance_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_instances_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_instances_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instances.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListInstancesAuditResponse]: + """List history about your instances (audit) + + List and filters the history about your instances. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instances. + :type instance_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_instances_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_instances_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instances.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your instances (audit) + + List and filters the history about your instances. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instances. + :type instance_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_instances_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListInstancesAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_instances_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + instance_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if instance_id is not None: + + _query_params.append(('instanceId', instance_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/instances/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_instances_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/internal_api.py b/pfruck_contabo/api/internal_api.py index cd8e0c5..f930a88 100644 --- a/pfruck_contabo/api/internal_api.py +++ b/pfruck_contabo/api/internal_api.py @@ -1,351 +1,632 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -import re # noqa: F401 -import sys # noqa: F401 +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 pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_ticket_request import CreateTicketRequest -from pfruck_contabo.model.create_ticket_response import CreateTicketResponse -from pfruck_contabo.model.find_user_is_password_set_response import FindUserIsPasswordSetResponse +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_ticket_request import CreateTicketRequest +from pfruck_contabo.models.create_ticket_response import CreateTicketResponse +from pfruck_contabo.models.find_user_is_password_set_response import FindUserIsPasswordSetResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class InternalApi(object): + +class InternalApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_ticket_endpoint = _Endpoint( - settings={ - 'response_type': (CreateTicketResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/create-ticket', - 'operation_id': 'create_ticket', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_ticket_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_ticket_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_ticket_request': - (CreateTicketRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_ticket_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + + @validate_call + def create_ticket( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_ticket_request: CreateTicketRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateTicketResponse: + """Create a new support ticket + + Create a new support ticket. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_ticket_request: (required) + :type create_ticket_request: CreateTicketRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ticket_serialize( + x_request_id=x_request_id, + create_ticket_request=create_ticket_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.retrieve_user_is_password_set_endpoint = _Endpoint( - settings={ - 'response_type': (FindUserIsPasswordSetResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/is-password-set', - 'operation_id': 'retrieve_user_is_password_set', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'user_id', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'user_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'user_id': 'userId', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'user_id': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateTicketResponse", + } + 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 - def create_ticket( + + @validate_call + def create_ticket_with_http_info( self, - x_request_id, - create_ticket_request, - **kwargs - ): - """Create a new support ticket # noqa: E501 - - Create a new support ticket. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_ticket(x_request_id, create_ticket_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_ticket_request (CreateTicketRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateTicketResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_ticket_request: CreateTicketRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateTicketResponse]: + """Create a new support ticket + + Create a new support ticket. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_ticket_request: (required) + :type create_ticket_request: CreateTicketRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ticket_serialize( + x_request_id=x_request_id, + create_ticket_request=create_ticket_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateTicketResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def create_ticket_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_ticket_request: CreateTicketRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new support ticket + + Create a new support ticket. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_ticket_request: (required) + :type create_ticket_request: CreateTicketRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_ticket_serialize( + x_request_id=x_request_id, + create_ticket_request=create_ticket_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateTicketResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _create_ticket_serialize( + self, + x_request_id, + create_ticket_request, + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_ticket_request is not None: + _body_params = create_ticket_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/create-ticket', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_ticket_request'] = \ - create_ticket_request - return self.create_ticket_endpoint.call_with_http_info(**kwargs) + + + + @validate_call def retrieve_user_is_password_set( self, - x_request_id, - **kwargs - ): - """Get user is password set status # noqa: E501 - - Get info about idm user if the password is set. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_user_is_password_set(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - user_id (str): The user ID for checking if password is set for him. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindUserIsPasswordSetResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="The user ID for checking if password is set for him")] = 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, + ) -> FindUserIsPasswordSetResponse: + """Get user is password set status + + Get info about idm user if the password is set. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param user_id: The user ID for checking if password is set for him + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_is_password_set_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindUserIsPasswordSetResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_user_is_password_set_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="The user ID for checking if password is set for him")] = 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[FindUserIsPasswordSetResponse]: + """Get user is password set status + + Get info about idm user if the password is set. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param user_id: The user ID for checking if password is set for him + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_is_password_set_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindUserIsPasswordSetResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_user_is_password_set_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="The user ID for checking if password is set for him")] = 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 user is password set status + + Get info about idm user if the password is set. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param user_id: The user ID for checking if password is set for him + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_is_password_set_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindUserIsPasswordSetResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_user_is_password_set_endpoint.call_with_http_info(**kwargs) + return response_data.response + + + def _retrieve_user_is_password_set_serialize( + self, + x_request_id, + x_trace_id, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if user_id is not None: + + _query_params.append(('userId', user_id)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/is-password-set', + 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/pfruck_contabo/api/object_storages_api.py b/pfruck_contabo/api/object_storages_api.py index 708e214..38c5ab5 100644 --- a/pfruck_contabo/api/object_storages_api.py +++ b/pfruck_contabo/api/object_storages_api.py @@ -1,1417 +1,2631 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" - + Generated by OpenAPI Generator (https://openapi-generator.tech) -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.cancel_object_storage_response import CancelObjectStorageResponse -from pfruck_contabo.model.create_object_storage_request import CreateObjectStorageRequest -from pfruck_contabo.model.create_object_storage_response import CreateObjectStorageResponse -from pfruck_contabo.model.find_object_storage_response import FindObjectStorageResponse -from pfruck_contabo.model.list_data_center_response import ListDataCenterResponse -from pfruck_contabo.model.list_object_storage_response import ListObjectStorageResponse -from pfruck_contabo.model.object_storages_stats_response import ObjectStoragesStatsResponse -from pfruck_contabo.model.patch_object_storage_request import PatchObjectStorageRequest -from pfruck_contabo.model.upgrade_object_storage_request import UpgradeObjectStorageRequest -from pfruck_contabo.model.upgrade_object_storage_response import UpgradeObjectStorageResponse - - -class ObjectStoragesApi(object): + 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, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.cancel_object_storage_response import CancelObjectStorageResponse +from pfruck_contabo.models.create_object_storage_request import CreateObjectStorageRequest +from pfruck_contabo.models.create_object_storage_response import CreateObjectStorageResponse +from pfruck_contabo.models.find_object_storage_response import FindObjectStorageResponse +from pfruck_contabo.models.list_data_center_response import ListDataCenterResponse +from pfruck_contabo.models.list_object_storage_response import ListObjectStorageResponse +from pfruck_contabo.models.object_storages_stats_response import ObjectStoragesStatsResponse +from pfruck_contabo.models.patch_object_storage_request import PatchObjectStorageRequest +from pfruck_contabo.models.upgrade_object_storage_request import UpgradeObjectStorageRequest +from pfruck_contabo.models.upgrade_object_storage_response import UpgradeObjectStorageResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class ObjectStoragesApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.cancel_object_storage_endpoint = _Endpoint( - settings={ - 'response_type': (CancelObjectStorageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages/{objectStorageId}/cancel', - 'operation_id': 'cancel_object_storage', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'object_storage_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'object_storage_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'object_storage_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'object_storage_id': 'objectStorageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'object_storage_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.create_object_storage_endpoint = _Endpoint( - settings={ - 'response_type': (CreateObjectStorageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages', - 'operation_id': 'create_object_storage', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_object_storage_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_object_storage_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_object_storage_request': - (CreateObjectStorageRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_object_storage_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.retrieve_data_center_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListDataCenterResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/data-centers', - 'operation_id': 'retrieve_data_center_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'slug', - 'name', - 'region_name', - 'region_slug', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - 'slug', - 'name', - 'region_name', - 'region_slug', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - ('slug',): { - - 'min_length': 1, - }, - ('name',): { - - 'min_length': 1, - }, - ('region_name',): { - - 'min_length': 1, - }, - ('region_slug',): { - - 'min_length': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'slug': - (str,), - 'name': - (str,), - 'region_name': - (str,), - 'region_slug': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'slug': 'slug', - 'name': 'name', - 'region_name': 'regionName', - 'region_slug': 'regionSlug', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'slug': 'query', - 'name': 'query', - 'region_name': 'query', - 'region_slug': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_object_storage_endpoint = _Endpoint( - settings={ - 'response_type': (FindObjectStorageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages/{objectStorageId}', - 'operation_id': 'retrieve_object_storage', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'object_storage_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'object_storage_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'object_storage_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'object_storage_id': 'objectStorageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'object_storage_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_object_storage_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListObjectStorageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages', - 'operation_id': 'retrieve_object_storage_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'data_center_name', - 's3_tenant_id', - 'region', - 'display_name', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - 'data_center_name', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - ('data_center_name',): { - - 'min_length': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'data_center_name': - (str,), - 's3_tenant_id': - (str,), - 'region': - (str,), - 'display_name': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'data_center_name': 'dataCenterName', - 's3_tenant_id': 's3TenantId', - 'region': 'region', - 'display_name': 'displayName', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'data_center_name': 'query', - 's3_tenant_id': 'query', - 'region': 'query', - 'display_name': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_object_storages_stats_endpoint = _Endpoint( - settings={ - 'response_type': (ObjectStoragesStatsResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages/{objectStorageId}/stats', - 'operation_id': 'retrieve_object_storages_stats', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'object_storage_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'object_storage_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'object_storage_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'object_storage_id': 'objectStorageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'object_storage_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_object_storage_endpoint = _Endpoint( - settings={ - 'response_type': (CancelObjectStorageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages/{objectStorageId}', - 'operation_id': 'update_object_storage', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'object_storage_id', - 'patch_object_storage_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'object_storage_id', - 'patch_object_storage_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'object_storage_id': - (str,), - 'patch_object_storage_request': - (PatchObjectStorageRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'object_storage_id': 'objectStorageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'object_storage_id': 'path', - 'patch_object_storage_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.upgrade_object_storage_endpoint = _Endpoint( - settings={ - 'response_type': (UpgradeObjectStorageResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages/{objectStorageId}/resize', - 'operation_id': 'upgrade_object_storage', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'object_storage_id', - 'upgrade_object_storage_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'object_storage_id', - 'upgrade_object_storage_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'object_storage_id': - (str,), - 'upgrade_object_storage_request': - (UpgradeObjectStorageRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'object_storage_id': 'objectStorageId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'object_storage_id': 'path', - 'upgrade_object_storage_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def cancel_object_storage( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CancelObjectStorageResponse: + """Cancels the specified object storage at the next possible date + + Cancels the specified object storage at the next possible date. Please be aware of your contract periods. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CancelObjectStorageResponse", + } + 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 cancel_object_storage_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CancelObjectStorageResponse]: + """Cancels the specified object storage at the next possible date + + Cancels the specified object storage at the next possible date. Please be aware of your contract periods. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CancelObjectStorageResponse", + } + 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 cancel_object_storage_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Cancels the specified object storage at the next possible date + + Cancels the specified object storage at the next possible date. Please be aware of your contract periods. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CancelObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _cancel_object_storage_serialize( self, x_request_id, object_storage_id, - **kwargs - ): - """Cancels the specified object storage at the next possible date # noqa: E501 - - Cancels the specified object storage at the next possible date. Please be aware of your contract periods. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.cancel_object_storage(x_request_id, object_storage_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id (str): The identifier of the object storage. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CancelObjectStorageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['object_storage_id'] = \ - object_storage_id - return self.cancel_object_storage_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if object_storage_id is not None: + _path_params['objectStorageId'] = object_storage_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/object-storages/{objectStorageId}/cancel', + 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_object_storage( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_object_storage_request: CreateObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateObjectStorageResponse: + """Create a new object storage + + Create / purchase a new object storage in your account. Please note that you can only buy one object storage per location. You can actually increase the object storage space via `POST` to `/v1/object-storages/{objectStorageId}/resize` + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_object_storage_request: (required) + :type create_object_storage_request: CreateObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_object_storage_serialize( + x_request_id=x_request_id, + create_object_storage_request=create_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateObjectStorageResponse", + } + 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_object_storage_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_object_storage_request: CreateObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateObjectStorageResponse]: + """Create a new object storage + + Create / purchase a new object storage in your account. Please note that you can only buy one object storage per location. You can actually increase the object storage space via `POST` to `/v1/object-storages/{objectStorageId}/resize` + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_object_storage_request: (required) + :type create_object_storage_request: CreateObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_object_storage_serialize( + x_request_id=x_request_id, + create_object_storage_request=create_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateObjectStorageResponse", + } + 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_object_storage_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_object_storage_request: CreateObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new object storage + + Create / purchase a new object storage in your account. Please note that you can only buy one object storage per location. You can actually increase the object storage space via `POST` to `/v1/object-storages/{objectStorageId}/resize` + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_object_storage_request: (required) + :type create_object_storage_request: CreateObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_object_storage_serialize( + x_request_id=x_request_id, + create_object_storage_request=create_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_object_storage_serialize( self, x_request_id, create_object_storage_request, - **kwargs - ): - """Create a new object storage # noqa: E501 - - Create / purchase a new object storage in your account. Please note that you can only buy one object storage per location. You can actually increase the object storage space via `POST` to `/v1/object-storages/{objectStorageId}/resize` # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_object_storage(x_request_id, create_object_storage_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_object_storage_request (CreateObjectStorageRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateObjectStorageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_object_storage_request'] = \ - create_object_storage_request - return self.create_object_storage_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_object_storage_request is not None: + _body_params = create_object_storage_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/object-storages', + 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 retrieve_data_center_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + slug: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter as match for data centers.")] = None, + name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storages regions.")] = None, + region_name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage region names.")] = None, + region_slug: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage region slugs.")] = 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, + ) -> ListDataCenterResponse: + """List data centers + + List all data centers and their corresponding regions. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param slug: Filter as match for data centers. + :type slug: str + :param name: Filter for Object Storages regions. + :type name: str + :param region_name: Filter for Object Storage region names. + :type region_name: str + :param region_slug: Filter for Object Storage region slugs. + :type region_slug: 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._retrieve_data_center_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + slug=slug, + name=name, + region_name=region_name, + region_slug=region_slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListDataCenterResponse", + } + 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 retrieve_data_center_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + slug: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter as match for data centers.")] = None, + name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storages regions.")] = None, + region_name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage region names.")] = None, + region_slug: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage region slugs.")] = 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[ListDataCenterResponse]: + """List data centers + + List all data centers and their corresponding regions. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param slug: Filter as match for data centers. + :type slug: str + :param name: Filter for Object Storages regions. + :type name: str + :param region_name: Filter for Object Storage region names. + :type region_name: str + :param region_slug: Filter for Object Storage region slugs. + :type region_slug: 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._retrieve_data_center_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + slug=slug, + name=name, + region_name=region_name, + region_slug=region_slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListDataCenterResponse", + } + 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 retrieve_data_center_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + slug: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter as match for data centers.")] = None, + name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storages regions.")] = None, + region_name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage region names.")] = None, + region_slug: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage region slugs.")] = 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 data centers + + List all data centers and their corresponding regions. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param slug: Filter as match for data centers. + :type slug: str + :param name: Filter for Object Storages regions. + :type name: str + :param region_name: Filter for Object Storage region names. + :type region_name: str + :param region_slug: Filter for Object Storage region slugs. + :type region_slug: 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._retrieve_data_center_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + slug=slug, + name=name, + region_name=region_name, + region_slug=region_slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListDataCenterResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_data_center_list_serialize( self, x_request_id, - **kwargs - ): - """List data centers # noqa: E501 - - List all data centers and their corresponding regions. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_data_center_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - slug (str): Filter as match for data centers.. [optional] - name (str): Filter for Object Storages regions.. [optional] - region_name (str): Filter for Object Storage region names.. [optional] - region_slug (str): Filter for Object Storage region slugs.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListDataCenterResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_data_center_list_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + page, + size, + order_by, + slug, + name, + region_name, + region_slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if slug is not None: + + _query_params.append(('slug', slug)) + + if name is not None: + + _query_params.append(('name', name)) + + if region_name is not None: + + _query_params.append(('regionName', region_name)) + + if region_slug is not None: + + _query_params.append(('regionSlug', region_slug)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/data-centers', + 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 retrieve_object_storage( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindObjectStorageResponse: + """Get specific object storage by its id + + Get data for a specific object storage on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindObjectStorageResponse", + } + 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 retrieve_object_storage_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindObjectStorageResponse]: + """Get specific object storage by its id + + Get data for a specific object storage on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindObjectStorageResponse", + } + 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 retrieve_object_storage_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific object storage by its id + + Get data for a specific object storage on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_object_storage_serialize( self, x_request_id, object_storage_id, - **kwargs - ): - """Get specific object storage by its id # noqa: E501 - - Get data for a specific object storage on your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_object_storage(x_request_id, object_storage_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id (str): The identifier of the object storage. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindObjectStorageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['object_storage_id'] = \ - object_storage_id - return self.retrieve_object_storage_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if object_storage_id is not None: + _path_params['objectStorageId'] = object_storage_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/object-storages/{objectStorageId}', + 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 retrieve_object_storage_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + data_center_name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage locations.")] = None, + s3_tenant_id: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage S3 tenantId.")] = None, + region: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by regions. Available regions: EU, US-central, SIN")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by display name.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListObjectStorageResponse: + """List all your object storages + + List and filter all object storages in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param data_center_name: Filter for Object Storage locations. + :type data_center_name: str + :param s3_tenant_id: Filter for Object Storage S3 tenantId. + :type s3_tenant_id: str + :param region: Filter for Object Storage by regions. Available regions: EU, US-central, SIN + :type region: str + :param display_name: Filter for Object Storage by display name. + :type display_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._retrieve_object_storage_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + data_center_name=data_center_name, + s3_tenant_id=s3_tenant_id, + region=region, + display_name=display_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListObjectStorageResponse", + } + 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 retrieve_object_storage_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + data_center_name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage locations.")] = None, + s3_tenant_id: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage S3 tenantId.")] = None, + region: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by regions. Available regions: EU, US-central, SIN")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by display name.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListObjectStorageResponse]: + """List all your object storages + + List and filter all object storages in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param data_center_name: Filter for Object Storage locations. + :type data_center_name: str + :param s3_tenant_id: Filter for Object Storage S3 tenantId. + :type s3_tenant_id: str + :param region: Filter for Object Storage by regions. Available regions: EU, US-central, SIN + :type region: str + :param display_name: Filter for Object Storage by display name. + :type display_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._retrieve_object_storage_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + data_center_name=data_center_name, + s3_tenant_id=s3_tenant_id, + region=region, + display_name=display_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListObjectStorageResponse", + } + 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 retrieve_object_storage_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + data_center_name: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Filter for Object Storage locations.")] = None, + s3_tenant_id: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage S3 tenantId.")] = None, + region: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by regions. Available regions: EU, US-central, SIN")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by display name.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all your object storages + + List and filter all object storages in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param data_center_name: Filter for Object Storage locations. + :type data_center_name: str + :param s3_tenant_id: Filter for Object Storage S3 tenantId. + :type s3_tenant_id: str + :param region: Filter for Object Storage by regions. Available regions: EU, US-central, SIN + :type region: str + :param display_name: Filter for Object Storage by display name. + :type display_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._retrieve_object_storage_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + data_center_name=data_center_name, + s3_tenant_id=s3_tenant_id, + region=region, + display_name=display_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_object_storage_list_serialize( self, x_request_id, - **kwargs - ): - """List all your object storages # noqa: E501 - - List and filter all object storages in your account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_object_storage_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - data_center_name (str): Filter for Object Storage locations.. [optional] - s3_tenant_id (str): Filter for Object Storage S3 tenantId.. [optional] - region (str): Filter for Object Storage by regions. Available regions: EU, US-central, SIN. [optional] - display_name (str): Filter for Object Storage by display name.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListObjectStorageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_object_storage_list_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + page, + size, + order_by, + data_center_name, + s3_tenant_id, + region, + display_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if data_center_name is not None: + + _query_params.append(('dataCenterName', data_center_name)) + + if s3_tenant_id is not None: + + _query_params.append(('s3TenantId', s3_tenant_id)) + + if region is not None: + + _query_params.append(('region', region)) + + if display_name is not None: + + _query_params.append(('displayName', display_name)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/object-storages', + 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 retrieve_object_storages_stats( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> ObjectStoragesStatsResponse: + """List usage statistics about the specified object storage + + List usage statistics about the specified object storage such as the number of objects uploaded / created, used object storage space. Please note that the usage statistics are updated regularly and are not live usage statistics. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_object_storages_stats_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStoragesStatsResponse", + } + 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 retrieve_object_storages_stats_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[ObjectStoragesStatsResponse]: + """List usage statistics about the specified object storage + + List usage statistics about the specified object storage such as the number of objects uploaded / created, used object storage space. Please note that the usage statistics are updated regularly and are not live usage statistics. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_object_storages_stats_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStoragesStatsResponse", + } + 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 retrieve_object_storages_stats_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 usage statistics about the specified object storage + + List usage statistics about the specified object storage such as the number of objects uploaded / created, used object storage space. Please note that the usage statistics are updated regularly and are not live usage statistics. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_object_storages_stats_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ObjectStoragesStatsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_object_storages_stats_serialize( self, x_request_id, object_storage_id, - **kwargs - ): - """List usage statistics about the specified object storage # noqa: E501 - - List usage statistics about the specified object storage such as the number of objects uploaded / created, used object storage space. Please note that the usage statistics are updated regularly and are not live usage statistics. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_object_storages_stats(x_request_id, object_storage_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id (str): The identifier of the object storage. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ObjectStoragesStatsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['object_storage_id'] = \ - object_storage_id - return self.retrieve_object_storages_stats_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if object_storage_id is not None: + _path_params['objectStorageId'] = object_storage_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/object-storages/{objectStorageId}/stats', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def update_object_storage( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + patch_object_storage_request: PatchObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CancelObjectStorageResponse: + """Modifies the display name of object storage + + Modifies the display name of object storage. Display name must be unique. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param patch_object_storage_request: (required) + :type patch_object_storage_request: PatchObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + patch_object_storage_request=patch_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CancelObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_object_storage_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + patch_object_storage_request: PatchObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CancelObjectStorageResponse]: + """Modifies the display name of object storage + + Modifies the display name of object storage. Display name must be unique. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param patch_object_storage_request: (required) + :type patch_object_storage_request: PatchObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + patch_object_storage_request=patch_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CancelObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_object_storage_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + patch_object_storage_request: PatchObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Modifies the display name of object storage + + Modifies the display name of object storage. Display name must be unique. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param patch_object_storage_request: (required) + :type patch_object_storage_request: PatchObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + patch_object_storage_request=patch_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CancelObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_object_storage_serialize( self, x_request_id, object_storage_id, patch_object_storage_request, - **kwargs - ): - """Modifies the display name of object storage # noqa: E501 - - Modifies the display name of object storage. Display name must be unique. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_object_storage(x_request_id, object_storage_id, patch_object_storage_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id (str): The identifier of the object storage. - patch_object_storage_request (PatchObjectStorageRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CancelObjectStorageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['object_storage_id'] = \ - object_storage_id - kwargs['patch_object_storage_request'] = \ - patch_object_storage_request - return self.update_object_storage_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if object_storage_id is not None: + _path_params['objectStorageId'] = object_storage_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if patch_object_storage_request is not None: + _body_params = patch_object_storage_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/object-storages/{objectStorageId}', + 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 upgrade_object_storage( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + upgrade_object_storage_request: UpgradeObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UpgradeObjectStorageResponse: + """Upgrade object storage size resp. update autoscaling settings. + + Upgrade object storage size. You can also adjust the autoscaling settings for your object storage. Autoscaling allows you to automatically purchase storage capacity on a monthly basis up to the specified limit. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param upgrade_object_storage_request: (required) + :type upgrade_object_storage_request: UpgradeObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upgrade_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + upgrade_object_storage_request=upgrade_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpgradeObjectStorageResponse", + } + 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 upgrade_object_storage_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + upgrade_object_storage_request: UpgradeObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UpgradeObjectStorageResponse]: + """Upgrade object storage size resp. update autoscaling settings. + + Upgrade object storage size. You can also adjust the autoscaling settings for your object storage. Autoscaling allows you to automatically purchase storage capacity on a monthly basis up to the specified limit. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param upgrade_object_storage_request: (required) + :type upgrade_object_storage_request: UpgradeObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upgrade_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + upgrade_object_storage_request=upgrade_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpgradeObjectStorageResponse", + } + 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 upgrade_object_storage_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the object storage.")], + upgrade_object_storage_request: UpgradeObjectStorageRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Upgrade object storage size resp. update autoscaling settings. + + Upgrade object storage size. You can also adjust the autoscaling settings for your object storage. Autoscaling allows you to automatically purchase storage capacity on a monthly basis up to the specified limit. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param object_storage_id: The identifier of the object storage. (required) + :type object_storage_id: str + :param upgrade_object_storage_request: (required) + :type upgrade_object_storage_request: UpgradeObjectStorageRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._upgrade_object_storage_serialize( + x_request_id=x_request_id, + object_storage_id=object_storage_id, + upgrade_object_storage_request=upgrade_object_storage_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpgradeObjectStorageResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _upgrade_object_storage_serialize( self, x_request_id, object_storage_id, upgrade_object_storage_request, - **kwargs - ): - """Upgrade object storage size resp. update autoscaling settings. # noqa: E501 - - Upgrade object storage size. You can also adjust the autoscaling settings for your object storage. Autoscaling allows you to automatically purchase storage capacity on a monthly basis up to the specified limit. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.upgrade_object_storage(x_request_id, object_storage_id, upgrade_object_storage_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - object_storage_id (str): The identifier of the object storage. - upgrade_object_storage_request (UpgradeObjectStorageRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UpgradeObjectStorageResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['object_storage_id'] = \ - object_storage_id - kwargs['upgrade_object_storage_request'] = \ - upgrade_object_storage_request - return self.upgrade_object_storage_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if object_storage_id is not None: + _path_params['objectStorageId'] = object_storage_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if upgrade_object_storage_request is not None: + _body_params = upgrade_object_storage_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/object-storages/{objectStorageId}/resize', + 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/pfruck_contabo/api/object_storages_audits_api.py b/pfruck_contabo/api/object_storages_audits_api.py index cf9a486..39068aa 100644 --- a/pfruck_contabo/api/object_storages_audits_api.py +++ b/pfruck_contabo/api/object_storages_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_object_storage_audit_response import ListObjectStorageAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_object_storage_audit_response import ListObjectStorageAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class ObjectStoragesAuditsApi(object): +class ObjectStoragesAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_object_storage_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListObjectStorageAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/object-storages/audits', - 'operation_id': 'retrieve_object_storage_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'object_storage_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'object_storage_id': - (str,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'object_storage_id': 'objectStorageId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'object_storage_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_object_storage_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your object storages (audit) # noqa: E501 - - List and filters the history about your object storages. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_object_storage_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - object_storage_id (str): The identifier of the object storage.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): changedBy of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListObjectStorageAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + object_storage_id: Annotated[Optional[StrictStr], Field(description="The identifier of the object storage.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListObjectStorageAuditResponse: + """List history about your object storages (audit) + + List and filters the history about your object storages. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param object_storage_id: The identifier of the object storage. + :type object_storage_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_object_storage_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + object_storage_id=object_storage_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListObjectStorageAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_object_storage_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + object_storage_id: Annotated[Optional[StrictStr], Field(description="The identifier of the object storage.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListObjectStorageAuditResponse]: + """List history about your object storages (audit) + + List and filters the history about your object storages. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param object_storage_id: The identifier of the object storage. + :type object_storage_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_object_storage_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + object_storage_id=object_storage_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListObjectStorageAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_object_storage_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + object_storage_id: Annotated[Optional[StrictStr], Field(description="The identifier of the object storage.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your object storages (audit) + + List and filters the history about your object storages. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param object_storage_id: The identifier of the object storage. + :type object_storage_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_object_storage_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + object_storage_id=object_storage_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListObjectStorageAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_object_storage_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + object_storage_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if object_storage_id is not None: + + _query_params.append(('objectStorageId', object_storage_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/object-storages/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_object_storage_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/private_networks_api.py b/pfruck_contabo/api/private_networks_api.py index db6f613..8c8bed7 100644 --- a/pfruck_contabo/api/private_networks_api.py +++ b/pfruck_contabo/api/private_networks_api.py @@ -1,1207 +1,2232 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse +from pfruck_contabo.models.create_private_network_request import CreatePrivateNetworkRequest +from pfruck_contabo.models.create_private_network_response import CreatePrivateNetworkResponse +from pfruck_contabo.models.find_private_network_response import FindPrivateNetworkResponse +from pfruck_contabo.models.list_private_network_response import ListPrivateNetworkResponse +from pfruck_contabo.models.patch_private_network_request import PatchPrivateNetworkRequest +from pfruck_contabo.models.patch_private_network_response import PatchPrivateNetworkResponse +from pfruck_contabo.models.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse -from pfruck_contabo.model.create_private_network_request import CreatePrivateNetworkRequest -from pfruck_contabo.model.create_private_network_response import CreatePrivateNetworkResponse -from pfruck_contabo.model.find_private_network_response import FindPrivateNetworkResponse -from pfruck_contabo.model.list_private_network_response import ListPrivateNetworkResponse -from pfruck_contabo.model.patch_private_network_request import PatchPrivateNetworkRequest -from pfruck_contabo.model.patch_private_network_response import PatchPrivateNetworkResponse -from pfruck_contabo.model.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse - - -class PrivateNetworksApi(object): +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class PrivateNetworksApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.assign_instance_private_network_endpoint = _Endpoint( - settings={ - 'response_type': (AssignInstancePrivateNetworkResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks/{privateNetworkId}/instances/{instanceId}', - 'operation_id': 'assign_instance_private_network', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'private_network_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'private_network_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'private_network_id': - (int,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'private_network_id': 'privateNetworkId', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'private_network_id': 'path', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def assign_instance_private_network( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> AssignInstancePrivateNetworkResponse: + """Add instance to a Private Network + + Add a specific instance to a Private Network + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_instance_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.create_private_network_endpoint = _Endpoint( - settings={ - 'response_type': (CreatePrivateNetworkResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks', - 'operation_id': 'create_private_network', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_private_network_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_private_network_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_private_network_request': - (CreatePrivateNetworkRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_private_network_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AssignInstancePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.delete_private_network_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks/{privateNetworkId}', - 'operation_id': 'delete_private_network', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'private_network_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'private_network_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'private_network_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'private_network_id': 'privateNetworkId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'private_network_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def assign_instance_private_network_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[AssignInstancePrivateNetworkResponse]: + """Add instance to a Private Network + + Add a specific instance to a Private Network + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_instance_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.patch_private_network_endpoint = _Endpoint( - settings={ - 'response_type': (PatchPrivateNetworkResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks/{privateNetworkId}', - 'operation_id': 'patch_private_network', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'private_network_id', - 'patch_private_network_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'private_network_id', - 'patch_private_network_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'private_network_id': - (int,), - 'patch_private_network_request': - (PatchPrivateNetworkRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'private_network_id': 'privateNetworkId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'private_network_id': 'path', - 'patch_private_network_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AssignInstancePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.retrieve_private_network_endpoint = _Endpoint( - settings={ - 'response_type': (FindPrivateNetworkResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks/{privateNetworkId}', - 'operation_id': 'retrieve_private_network', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'private_network_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'private_network_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'private_network_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'private_network_id': 'privateNetworkId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'private_network_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.retrieve_private_network_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListPrivateNetworkResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks', - 'operation_id': 'retrieve_private_network_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'name', - 'instance_ids', - 'region', - 'data_center', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'name': - (str,), - 'instance_ids': - (str,), - 'region': - (str,), - 'data_center': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'name': 'name', - 'instance_ids': 'instanceIds', - 'region': 'region', - 'data_center': 'dataCenter', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'name': 'query', - 'instance_ids': 'query', - 'region': 'query', - 'data_center': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + + @validate_call + def assign_instance_private_network_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Add instance to a Private Network + + Add a specific instance to a Private Network + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_instance_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.unassign_instance_private_network_endpoint = _Endpoint( - settings={ - 'response_type': (UnassignInstancePrivateNetworkResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks/{privateNetworkId}/instances/{instanceId}', - 'operation_id': 'unassign_instance_private_network', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'private_network_id', - 'instance_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'private_network_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'private_network_id': - (int,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'private_network_id': 'privateNetworkId', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'private_network_id': 'path', - 'instance_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "AssignInstancePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - def assign_instance_private_network( + + def _assign_instance_private_network_serialize( self, x_request_id, private_network_id, instance_id, - **kwargs - ): - """Add instance to a Private Network # noqa: E501 - - Add a specific instance to a Private Network # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.assign_instance_private_network(x_request_id, private_network_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - private_network_id (int): The identifier of the Private Network - instance_id (int): The identifier of the instance - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - AssignInstancePrivateNetworkResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if private_network_id is not None: + _path_params['privateNetworkId'] = private_network_id + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/private-networks/{privateNetworkId}/instances/{instanceId}', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def create_private_network( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_private_network_request: CreatePrivateNetworkRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreatePrivateNetworkResponse: + """Create a new Private Network + + Create a new Private Network in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_private_network_request: (required) + :type create_private_network_request: CreatePrivateNetworkRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_private_network_serialize( + x_request_id=x_request_id, + create_private_network_request=create_private_network_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_private_network_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_private_network_request: CreatePrivateNetworkRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreatePrivateNetworkResponse]: + """Create a new Private Network + + Create a new Private Network in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_private_network_request: (required) + :type create_private_network_request: CreatePrivateNetworkRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_private_network_serialize( + x_request_id=x_request_id, + create_private_network_request=create_private_network_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['private_network_id'] = \ - private_network_id - kwargs['instance_id'] = \ - instance_id - return self.assign_instance_private_network_endpoint.call_with_http_info(**kwargs) - def create_private_network( + + @validate_call + def create_private_network_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_private_network_request: CreatePrivateNetworkRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new Private Network + + Create a new Private Network in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_private_network_request: (required) + :type create_private_network_request: CreatePrivateNetworkRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_private_network_serialize( + x_request_id=x_request_id, + create_private_network_request=create_private_network_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreatePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_private_network_serialize( self, x_request_id, create_private_network_request, - **kwargs - ): - """Create a new Private Network # noqa: E501 - - Create a new Private Network in your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_private_network(x_request_id, create_private_network_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_private_network_request (CreatePrivateNetworkRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreatePrivateNetworkResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_private_network_request is not None: + _body_params = create_private_network_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/private-networks', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def delete_private_network( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing Private Network by id + + Delete existing Virtual Private Cloud by id and automatically unassign all instances from it + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_private_network_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete existing Private Network by id + + Delete existing Virtual Private Cloud by id and automatically unassign all instances from it + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_private_network_request'] = \ - create_private_network_request - return self.create_private_network_endpoint.call_with_http_info(**kwargs) - def delete_private_network( + + @validate_call + def delete_private_network_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing Private Network by id + + Delete existing Virtual Private Cloud by id and automatically unassign all instances from it + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_private_network_serialize( self, x_request_id, private_network_id, - **kwargs - ): - """Delete existing Private Network by id # noqa: E501 - - Delete existing Virtual Private Cloud by id and automatically unassign all instances from it # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_private_network(x_request_id, private_network_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - private_network_id (int): The identifier of the Private Network - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if private_network_id is not None: + _path_params['privateNetworkId'] = private_network_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/private-networks/{privateNetworkId}', + 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 ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + + + @validate_call + def patch_private_network( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + patch_private_network_request: PatchPrivateNetworkRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> PatchPrivateNetworkResponse: + """Update a Private Network by id + + Update a Private Network by id in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param patch_private_network_request: (required) + :type patch_private_network_request: PatchPrivateNetworkRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + patch_private_network_request=patch_private_network_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def patch_private_network_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + patch_private_network_request: PatchPrivateNetworkRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[PatchPrivateNetworkResponse]: + """Update a Private Network by id + + Update a Private Network by id in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param patch_private_network_request: (required) + :type patch_private_network_request: PatchPrivateNetworkRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + patch_private_network_request=patch_private_network_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + @validate_call + def patch_private_network_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + patch_private_network_request: PatchPrivateNetworkRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a Private Network by id + + Update a Private Network by id in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param patch_private_network_request: (required) + :type patch_private_network_request: PatchPrivateNetworkRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._patch_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + patch_private_network_request=patch_private_network_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['private_network_id'] = \ - private_network_id - return self.delete_private_network_endpoint.call_with_http_info(**kwargs) - def patch_private_network( + _response_types_map: Dict[str, Optional[str]] = { + '200': "PatchPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _patch_private_network_serialize( self, x_request_id, private_network_id, patch_private_network_request, - **kwargs - ): - """Update a Private Network by id # noqa: E501 - - Update a Private Network by id in your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.patch_private_network(x_request_id, private_network_id, patch_private_network_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - private_network_id (int): The identifier of the Private Network - patch_private_network_request (PatchPrivateNetworkRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - PatchPrivateNetworkResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if private_network_id is not None: + _path_params['privateNetworkId'] = private_network_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if patch_private_network_request is not None: + _body_params = patch_private_network_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/private-networks/{privateNetworkId}', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def retrieve_private_network( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindPrivateNetworkResponse: + """Get specific Private Network by id + + Get attributes values to a specific Private Network on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_private_network_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindPrivateNetworkResponse]: + """Get specific Private Network by id + + Get attributes values to a specific Private Network on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['private_network_id'] = \ - private_network_id - kwargs['patch_private_network_request'] = \ - patch_private_network_request - return self.patch_private_network_endpoint.call_with_http_info(**kwargs) - def retrieve_private_network( + + @validate_call + def retrieve_private_network_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific Private Network by id + + Get attributes values to a specific Private Network on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_private_network_serialize( self, x_request_id, private_network_id, - **kwargs - ): - """Get specific Private Network by id # noqa: E501 - - Get attributes values to a specific Private Network on your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_private_network(x_request_id, private_network_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - private_network_id (int): The identifier of the Private Network - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindPrivateNetworkResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if private_network_id is not None: + _path_params['privateNetworkId'] = private_network_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/private-networks/{privateNetworkId}', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def retrieve_private_network_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the Private Network")] = None, + instance_ids: Annotated[Optional[StrictStr], Field(description="Comma separated instances identifiers")] = None, + region: Annotated[Optional[StrictStr], Field(description="The slug of the region where your Private Network is located")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The data center where your Private Network is located")] = 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, + ) -> ListPrivateNetworkResponse: + """List Private Networks + + List and filter all Private Networks in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the Private Network + :type name: str + :param instance_ids: Comma separated instances identifiers + :type instance_ids: str + :param region: The slug of the region where your Private Network is located + :type region: str + :param data_center: The data center where your Private Network is located + :type data_center: 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._retrieve_private_network_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + instance_ids=instance_ids, + region=region, + data_center=data_center, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_private_network_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the Private Network")] = None, + instance_ids: Annotated[Optional[StrictStr], Field(description="Comma separated instances identifiers")] = None, + region: Annotated[Optional[StrictStr], Field(description="The slug of the region where your Private Network is located")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The data center where your Private Network is located")] = 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[ListPrivateNetworkResponse]: + """List Private Networks + + List and filter all Private Networks in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the Private Network + :type name: str + :param instance_ids: Comma separated instances identifiers + :type instance_ids: str + :param region: The slug of the region where your Private Network is located + :type region: str + :param data_center: The data center where your Private Network is located + :type data_center: 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._retrieve_private_network_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + instance_ids=instance_ids, + region=region, + data_center=data_center, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['private_network_id'] = \ - private_network_id - return self.retrieve_private_network_endpoint.call_with_http_info(**kwargs) - def retrieve_private_network_list( + + @validate_call + def retrieve_private_network_list_without_preload_content( self, - x_request_id, - **kwargs - ): - """List Private Networks # noqa: E501 - - List and filter all Private Networks in your account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_private_network_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - name (str): The name of the Private Network. [optional] - instance_ids (str): Comma separated instances identifiers. [optional] - region (str): The slug of the region where your Private Network is located. [optional] - data_center (str): The data center where your Private Network is located. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListPrivateNetworkResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the Private Network")] = None, + instance_ids: Annotated[Optional[StrictStr], Field(description="Comma separated instances identifiers")] = None, + region: Annotated[Optional[StrictStr], Field(description="The slug of the region where your Private Network is located")] = None, + data_center: Annotated[Optional[StrictStr], Field(description="The data center where your Private Network is located")] = 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 Private Networks + + List and filter all Private Networks in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the Private Network + :type name: str + :param instance_ids: Comma separated instances identifiers + :type instance_ids: str + :param region: The slug of the region where your Private Network is located + :type region: str + :param data_center: The data center where your Private Network is located + :type data_center: 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._retrieve_private_network_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + instance_ids=instance_ids, + region=region, + data_center=data_center, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListPrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + return response_data.response + + + def _retrieve_private_network_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + name, + instance_ids, + region, + data_center, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if name is not None: + + _query_params.append(('name', name)) + + if instance_ids is not None: + + _query_params.append(('instanceIds', instance_ids)) + + if region is not None: + + _query_params.append(('region', region)) + + if data_center is not None: + + _query_params.append(('dataCenter', data_center)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/private-networks', + 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 ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + + + @validate_call + def unassign_instance_private_network( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UnassignInstancePrivateNetworkResponse: + """Remove instance from a Private Network + + Remove a specific instance from a Private Network + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_instance_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '201': "UnassignInstancePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_private_network_list_endpoint.call_with_http_info(**kwargs) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def unassign_instance_private_network( + + @validate_call + def unassign_instance_private_network_with_http_info( self, - x_request_id, - private_network_id, - instance_id, - **kwargs - ): - """Remove instance from a Private Network # noqa: E501 - - Remove a specific instance from a Private Network # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unassign_instance_private_network(x_request_id, private_network_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - private_network_id (int): The identifier of the Private Network - instance_id (int): The identifier of the instance - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UnassignInstancePrivateNetworkResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UnassignInstancePrivateNetworkResponse]: + """Remove instance from a Private Network + + Remove a specific instance from a Private Network + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_instance_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '201': "UnassignInstancePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def unassign_instance_private_network_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + private_network_id: Annotated[StrictInt, Field(description="The identifier of the Private Network")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Remove instance from a Private Network + + Remove a specific instance from a Private Network + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param private_network_id: The identifier of the Private Network (required) + :type private_network_id: int + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_instance_private_network_serialize( + x_request_id=x_request_id, + private_network_id=private_network_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '201': "UnassignInstancePrivateNetworkResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _unassign_instance_private_network_serialize( + self, + x_request_id, + private_network_id, + instance_id, + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if private_network_id is not None: + _path_params['privateNetworkId'] = private_network_id + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/private-networks/{privateNetworkId}/instances/{instanceId}', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['private_network_id'] = \ - private_network_id - kwargs['instance_id'] = \ - instance_id - return self.unassign_instance_private_network_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/private_networks_audits_api.py b/pfruck_contabo/api/private_networks_audits_api.py index 6ba83d6..3e07341 100644 --- a/pfruck_contabo/api/private_networks_audits_api.py +++ b/pfruck_contabo/api/private_networks_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_private_network_audit_response import ListPrivateNetworkAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_private_network_audit_response import ListPrivateNetworkAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class PrivateNetworksAuditsApi(object): +class PrivateNetworksAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_private_network_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListPrivateNetworkAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/private-networks/audits', - 'operation_id': 'retrieve_private_network_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'private_network_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'private_network_id': - (int,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'private_network_id': 'privateNetworkId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'private_network_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_private_network_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your Private Networks (audit) # noqa: E501 - - List and filters the history about your Private Networks. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_private_network_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - private_network_id (int): The identifier of the Private Network. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): User name which did the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListPrivateNetworkAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + private_network_id: Annotated[Optional[StrictInt], Field(description="The identifier of the Private Network")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="User name which did the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListPrivateNetworkAuditResponse: + """List history about your Private Networks (audit) + + List and filters the history about your Private Networks. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param private_network_id: The identifier of the Private Network + :type private_network_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: User name which did the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_private_network_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + private_network_id=private_network_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListPrivateNetworkAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_private_network_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + private_network_id: Annotated[Optional[StrictInt], Field(description="The identifier of the Private Network")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="User name which did the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListPrivateNetworkAuditResponse]: + """List history about your Private Networks (audit) + + List and filters the history about your Private Networks. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param private_network_id: The identifier of the Private Network + :type private_network_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: User name which did the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_private_network_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + private_network_id=private_network_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListPrivateNetworkAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_private_network_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + private_network_id: Annotated[Optional[StrictInt], Field(description="The identifier of the Private Network")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="User name which did the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your Private Networks (audit) + + List and filters the history about your Private Networks. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param private_network_id: The identifier of the Private Network + :type private_network_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: User name which did the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_private_network_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + private_network_id=private_network_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListPrivateNetworkAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_private_network_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + private_network_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if private_network_id is not None: + + _query_params.append(('privateNetworkId', private_network_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/private-networks/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_private_network_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/roles_api.py b/pfruck_contabo/api/roles_api.py index 38246a1..f2bdb05 100644 --- a/pfruck_contabo/api/roles_api.py +++ b/pfruck_contabo/api/roles_api.py @@ -1,1044 +1,1967 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_role_request import CreateRoleRequest -from pfruck_contabo.model.create_role_response import CreateRoleResponse -from pfruck_contabo.model.find_role_response import FindRoleResponse -from pfruck_contabo.model.list_api_permission_response import ListApiPermissionResponse -from pfruck_contabo.model.list_role_response import ListRoleResponse -from pfruck_contabo.model.update_role_request import UpdateRoleRequest -from pfruck_contabo.model.update_role_response import UpdateRoleResponse - - -class RolesApi(object): +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_role_request import CreateRoleRequest +from pfruck_contabo.models.create_role_response import CreateRoleResponse +from pfruck_contabo.models.find_role_response import FindRoleResponse +from pfruck_contabo.models.list_api_permission_response import ListApiPermissionResponse +from pfruck_contabo.models.list_role_response import ListRoleResponse +from pfruck_contabo.models.update_role_request import UpdateRoleRequest +from pfruck_contabo.models.update_role_response import UpdateRoleResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class RolesApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_role_endpoint = _Endpoint( - settings={ - 'response_type': (CreateRoleResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/roles', - 'operation_id': 'create_role', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_role_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_role_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_role_request': - (CreateRoleRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_role_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + + @validate_call + def create_role( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_role_request: CreateRoleRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateRoleResponse: + """Create a new role + + Create a new role. In order to get a list availbale api enpoints (apiName) and their actions please refer to the GET api-permissions endpoint. For specifying `resources` please enter tag ids. For those to take effect please assign them to a resource in the tag management api. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_role_request: (required) + :type create_role_request: CreateRoleRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_role_serialize( + x_request_id=x_request_id, + create_role_request=create_role_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.delete_role_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/roles/{roleId}', - 'operation_id': 'delete_role', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'role_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'role_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'role_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'role_id': 'roleId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'role_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.retrieve_api_permissions_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListApiPermissionResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/roles/api-permissions', - 'operation_id': 'retrieve_api_permissions_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'api_name', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'api_name': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'api_name': 'apiName', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'api_name': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_role_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_role_request: CreateRoleRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateRoleResponse]: + """Create a new role + + Create a new role. In order to get a list availbale api enpoints (apiName) and their actions please refer to the GET api-permissions endpoint. For specifying `resources` please enter tag ids. For those to take effect please assign them to a resource in the tag management api. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_role_request: (required) + :type create_role_request: CreateRoleRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_role_serialize( + x_request_id=x_request_id, + create_role_request=create_role_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.retrieve_role_endpoint = _Endpoint( - settings={ - 'response_type': (FindRoleResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/roles/{roleId}', - 'operation_id': 'retrieve_role', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'role_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'role_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'role_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'role_id': 'roleId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'role_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.retrieve_role_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListRoleResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/roles', - 'operation_id': 'retrieve_role_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'name', - 'api_name', - 'tag_name', - 'type', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'name': - (str,), - 'api_name': - (str,), - 'tag_name': - (str,), - 'type': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'name': 'name', - 'api_name': 'apiName', - 'tag_name': 'tagName', - 'type': 'type', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'name': 'query', - 'api_name': 'query', - 'tag_name': 'query', - 'type': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.update_role_endpoint = _Endpoint( - settings={ - 'response_type': (UpdateRoleResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/roles/{roleId}', - 'operation_id': 'update_role', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'role_id', - 'update_role_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'role_id', - 'update_role_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'role_id': - (int,), - 'update_role_request': - (UpdateRoleRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'role_id': 'roleId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'role_id': 'path', - 'update_role_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + + @validate_call + def create_role_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_role_request: CreateRoleRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new role + + Create a new role. In order to get a list availbale api enpoints (apiName) and their actions please refer to the GET api-permissions endpoint. For specifying `resources` please enter tag ids. For those to take effect please assign them to a resource in the tag management api. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_role_request: (required) + :type create_role_request: CreateRoleRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_role_serialize( + x_request_id=x_request_id, + create_role_request=create_role_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - def create_role( + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_role_serialize( self, x_request_id, create_role_request, - **kwargs - ): - """Create a new role # noqa: E501 - - Create a new role. In order to get a list availbale api enpoints (apiName) and their actions please refer to the GET api-permissions endpoint. For specifying `resources` please enter tag ids. For those to take effect please assign them to a resource in the tag management api. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_role(x_request_id, create_role_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_role_request (CreateRoleRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateRoleResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_role_request is not None: + _body_params = create_role_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/roles', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def delete_role( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing role by id + + You can't delete a role if it is still assigned to a user. In such cases please remove the role from the users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_role_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete existing role by id + + You can't delete a role if it is still assigned to a user. In such cases please remove the role from the users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def delete_role_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing role by id + + You can't delete a role if it is still assigned to a user. In such cases please remove the role from the users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_role_request'] = \ - create_role_request - return self.create_role_endpoint.call_with_http_info(**kwargs) + return response_data.response - def delete_role( + + def _delete_role_serialize( self, x_request_id, role_id, - **kwargs - ): - """Delete existing role by id # noqa: E501 - - You can't delete a role if it is still assigned to a user. In such cases please remove the role from the users. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_role(x_request_id, role_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - role_id (int): The identifier of the role - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if role_id is not None: + _path_params['roleId'] = role_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/roles/{roleId}', + 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 retrieve_api_permissions_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + api_name: Annotated[Optional[StrictStr], Field(description="The name of api")] = 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, + ) -> ListApiPermissionResponse: + """List of API permissions + + List all available API permissions. This list serves as a reference for specifying roles. As endpoints differ in their possibilities not all actions are available for each endpoint. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param api_name: The name of api + :type api_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._retrieve_api_permissions_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + api_name=api_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListApiPermissionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_api_permissions_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + api_name: Annotated[Optional[StrictStr], Field(description="The name of api")] = 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[ListApiPermissionResponse]: + """List of API permissions + + List all available API permissions. This list serves as a reference for specifying roles. As endpoints differ in their possibilities not all actions are available for each endpoint. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param api_name: The name of api + :type api_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._retrieve_api_permissions_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + api_name=api_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListApiPermissionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_api_permissions_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + api_name: Annotated[Optional[StrictStr], Field(description="The name of api")] = 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 of API permissions + + List all available API permissions. This list serves as a reference for specifying roles. As endpoints differ in their possibilities not all actions are available for each endpoint. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param api_name: The name of api + :type api_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._retrieve_api_permissions_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + api_name=api_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListApiPermissionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['role_id'] = \ - role_id - return self.delete_role_endpoint.call_with_http_info(**kwargs) + return response_data.response - def retrieve_api_permissions_list( + + def _retrieve_api_permissions_list_serialize( self, x_request_id, - **kwargs - ): - """List of API permissions # noqa: E501 - - List all available API permissions. This list serves as a reference for specifying roles. As endpoints differ in their possibilities not all actions are available for each endpoint. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_api_permissions_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - api_name (str): The name of api. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListApiPermissionResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + page, + size, + order_by, + api_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if api_name is not None: + + _query_params.append(('apiName', api_name)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/roles/api-permissions', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def retrieve_role( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindRoleResponse: + """Get specific role by id + + Get attributes of specific role. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_role_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindRoleResponse]: + """Get specific role by id + + Get attributes of specific role. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_api_permissions_list_endpoint.call_with_http_info(**kwargs) - def retrieve_role( + + @validate_call + def retrieve_role_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific role by id + + Get attributes of specific role. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_role_serialize( self, x_request_id, role_id, - **kwargs - ): - """Get specific role by id # noqa: E501 - - Get attributes of specific role. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_role(x_request_id, role_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - role_id (int): The identifier of the role - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindRoleResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if role_id is not None: + _path_params['roleId'] = role_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/roles/{roleId}', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def retrieve_role_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the role")] = None, + api_name: Annotated[Optional[StrictStr], Field(description="The name of api")] = None, + tag_name: Annotated[Optional[StrictStr], Field(description="The name of the tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="The type of the tag. Can be either `default` or `custom`")] = 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, + ) -> ListRoleResponse: + """List roles + + List and filter all your roles. A role allows you to specify permission to api endpoints and resources like compute. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the role + :type name: str + :param api_name: The name of api + :type api_name: str + :param tag_name: The name of the tag + :type tag_name: str + :param type: The type of the tag. Can be either `default` or `custom` + :type type: 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._retrieve_role_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + api_name=api_name, + tag_name=tag_name, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_role_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the role")] = None, + api_name: Annotated[Optional[StrictStr], Field(description="The name of api")] = None, + tag_name: Annotated[Optional[StrictStr], Field(description="The name of the tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="The type of the tag. Can be either `default` or `custom`")] = 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[ListRoleResponse]: + """List roles + + List and filter all your roles. A role allows you to specify permission to api endpoints and resources like compute. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the role + :type name: str + :param api_name: The name of api + :type api_name: str + :param tag_name: The name of the tag + :type tag_name: str + :param type: The type of the tag. Can be either `default` or `custom` + :type type: 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._retrieve_role_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + api_name=api_name, + tag_name=tag_name, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['role_id'] = \ - role_id - return self.retrieve_role_endpoint.call_with_http_info(**kwargs) - def retrieve_role_list( + + @validate_call + def retrieve_role_list_without_preload_content( self, - x_request_id, - **kwargs - ): - """List roles # noqa: E501 - - List and filter all your roles. A role allows you to specify permission to api endpoints and resources like compute. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_role_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - name (str): The name of the role. [optional] - api_name (str): The name of api. [optional] - tag_name (str): The name of the tag. [optional] - type (str): The type of the tag. Can be either `default` or `custom`. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListRoleResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the role")] = None, + api_name: Annotated[Optional[StrictStr], Field(description="The name of api")] = None, + tag_name: Annotated[Optional[StrictStr], Field(description="The name of the tag")] = None, + type: Annotated[Optional[StrictStr], Field(description="The type of the tag. Can be either `default` or `custom`")] = 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 roles + + List and filter all your roles. A role allows you to specify permission to api endpoints and resources like compute. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: The name of the role + :type name: str + :param api_name: The name of api + :type api_name: str + :param tag_name: The name of the tag + :type tag_name: str + :param type: The type of the tag. Can be either `default` or `custom` + :type type: 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._retrieve_role_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + api_name=api_name, + tag_name=tag_name, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + return response_data.response + + + def _retrieve_role_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + name, + api_name, + tag_name, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if name is not None: + + _query_params.append(('name', name)) + + if api_name is not None: + + _query_params.append(('apiName', api_name)) + + if tag_name is not None: + + _query_params.append(('tagName', tag_name)) + + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/roles', + 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 ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + + + @validate_call + def update_role( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + update_role_request: UpdateRoleRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UpdateRoleResponse: + """Update specific role by id + + Update attributes to your role. Attributes are optional. If not set, the attributes will retain their original values. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param update_role_request: (required) + :type update_role_request: UpdateRoleRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + update_role_request=update_role_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_role_list_endpoint.call_with_http_info(**kwargs) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data - def update_role( + + @validate_call + def update_role_with_http_info( self, - x_request_id, - role_id, - update_role_request, - **kwargs - ): - """Update specific role by id # noqa: E501 - - Update attributes to your role. Attributes are optional. If not set, the attributes will retain their original values. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_role(x_request_id, role_id, update_role_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - role_id (int): The identifier of the role - update_role_request (UpdateRoleRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UpdateRoleResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + update_role_request: UpdateRoleRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UpdateRoleResponse]: + """Update specific role by id + + Update attributes to your role. Attributes are optional. If not set, the attributes will retain their original values. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param update_role_request: (required) + :type update_role_request: UpdateRoleRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + update_role_request=update_role_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + + @validate_call + def update_role_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + role_id: Annotated[StrictInt, Field(description="The identifier of the role")], + update_role_request: UpdateRoleRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update specific role by id + + Update attributes to your role. Attributes are optional. If not set, the attributes will retain their original values. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param role_id: The identifier of the role (required) + :type role_id: int + :param update_role_request: (required) + :type update_role_request: UpdateRoleRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_role_serialize( + x_request_id=x_request_id, + role_id=role_id, + update_role_request=update_role_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateRoleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + return response_data.response + + + def _update_role_serialize( + self, + x_request_id, + role_id, + update_role_request, + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if role_id is not None: + _path_params['roleId'] = role_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if update_role_request is not None: + _body_params = update_role_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/roles/{roleId}', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['role_id'] = \ - role_id - kwargs['update_role_request'] = \ - update_role_request - return self.update_role_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/roles_audits_api.py b/pfruck_contabo/api/roles_audits_api.py index fe6dc79..4b93991 100644 --- a/pfruck_contabo/api/roles_audits_api.py +++ b/pfruck_contabo/api/roles_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_role_audit_response import ListRoleAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_role_audit_response import ListRoleAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class RolesAuditsApi(object): +class RolesAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_role_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListRoleAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/roles/audits', - 'operation_id': 'retrieve_role_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'role_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'role_id': - (int,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'role_id': 'roleId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'role_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_role_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your roles (audit) # noqa: E501 - - List and filter the history about your roles. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_role_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - role_id (int): The identifier of the role.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): changedBy of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListRoleAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + role_id: Annotated[Optional[StrictInt], Field(description="The identifier of the role.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListRoleAuditResponse: + """List history about your roles (audit) + + List and filter the history about your roles. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param role_id: The identifier of the role. + :type role_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_role_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + role_id=role_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListRoleAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_role_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + role_id: Annotated[Optional[StrictInt], Field(description="The identifier of the role.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListRoleAuditResponse]: + """List history about your roles (audit) + + List and filter the history about your roles. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param role_id: The identifier of the role. + :type role_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_role_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + role_id=role_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListRoleAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_role_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + role_id: Annotated[Optional[StrictInt], Field(description="The identifier of the role.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your roles (audit) + + List and filter the history about your roles. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param role_id: The identifier of the role. + :type role_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_role_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + role_id=role_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListRoleAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_role_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + role_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if role_id is not None: + + _query_params.append(('roleId', role_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/roles/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_role_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/secrets_api.py b/pfruck_contabo/api/secrets_api.py index 1abc7dd..e5f2a2b 100644 --- a/pfruck_contabo/api/secrets_api.py +++ b/pfruck_contabo/api/secrets_api.py @@ -1,865 +1,1590 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_secret_request import CreateSecretRequest +from pfruck_contabo.models.create_secret_response import CreateSecretResponse +from pfruck_contabo.models.find_secret_response import FindSecretResponse +from pfruck_contabo.models.list_secret_response import ListSecretResponse +from pfruck_contabo.models.update_secret_request import UpdateSecretRequest +from pfruck_contabo.models.update_secret_response import UpdateSecretResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_secret_request import CreateSecretRequest -from pfruck_contabo.model.create_secret_response import CreateSecretResponse -from pfruck_contabo.model.find_secret_response import FindSecretResponse -from pfruck_contabo.model.list_secret_response import ListSecretResponse -from pfruck_contabo.model.update_secret_request import UpdateSecretRequest -from pfruck_contabo.model.update_secret_response import UpdateSecretResponse - - -class SecretsApi(object): +class SecretsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_secret_endpoint = _Endpoint( - settings={ - 'response_type': (CreateSecretResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/secrets', - 'operation_id': 'create_secret', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_secret_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_secret_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_secret_request': - (CreateSecretRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_secret_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.delete_secret_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/secrets/{secretId}', - 'operation_id': 'delete_secret', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'secret_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'secret_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'secret_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'secret_id': 'secretId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'secret_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_secret_endpoint = _Endpoint( - settings={ - 'response_type': (FindSecretResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/secrets/{secretId}', - 'operation_id': 'retrieve_secret', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'secret_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'secret_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'secret_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'secret_id': 'secretId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'secret_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_secret_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListSecretResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/secrets', - 'operation_id': 'retrieve_secret_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'name', - 'type', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - 'type', - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - ('type',): { - - "PASSWORD": "password", - "SSH": "ssh" - }, - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'name': - (str,), - 'type': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'name': 'name', - 'type': 'type', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'name': 'query', - 'type': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_secret_endpoint = _Endpoint( - settings={ - 'response_type': (UpdateSecretResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/secrets/{secretId}', - 'operation_id': 'update_secret', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'secret_id', - 'update_secret_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'secret_id', - 'update_secret_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'secret_id': - (int,), - 'update_secret_request': - (UpdateSecretRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'secret_id': 'secretId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'secret_id': 'path', - 'update_secret_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def create_secret( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_secret_request: CreateSecretRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateSecretResponse: + """Create a new secret + + Create a new secret in your account with attributes name, type and value. Attribute type can be password or ssh. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_secret_request: (required) + :type create_secret_request: CreateSecretRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_secret_serialize( + x_request_id=x_request_id, + create_secret_request=create_secret_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSecretResponse", + } + 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_secret_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_secret_request: CreateSecretRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateSecretResponse]: + """Create a new secret + + Create a new secret in your account with attributes name, type and value. Attribute type can be password or ssh. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_secret_request: (required) + :type create_secret_request: CreateSecretRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_secret_serialize( + x_request_id=x_request_id, + create_secret_request=create_secret_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSecretResponse", + } + 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_secret_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_secret_request: CreateSecretRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new secret + + Create a new secret in your account with attributes name, type and value. Attribute type can be password or ssh. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_secret_request: (required) + :type create_secret_request: CreateSecretRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_secret_serialize( + x_request_id=x_request_id, + create_secret_request=create_secret_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSecretResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_secret_serialize( self, x_request_id, create_secret_request, - **kwargs - ): - """Create a new secret # noqa: E501 - - Create a new secret in your account with attributes name, type and value. Attribute type can be password or ssh. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_secret(x_request_id, create_secret_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_secret_request (CreateSecretRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateSecretResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_secret_request'] = \ - create_secret_request - return self.create_secret_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_secret_request is not None: + _body_params = create_secret_request + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/secrets', + 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_secret( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing secret by id + + You can remove a specific secret from your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_secret_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete existing secret by id + + You can remove a specific secret from your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_secret_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing secret by id + + You can remove a specific secret from your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_secret_serialize( self, x_request_id, secret_id, - **kwargs - ): - """Delete existing secret by id # noqa: E501 - - You can remove a specific secret from your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_secret(x_request_id, secret_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - secret_id (int): The id of the secret - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['secret_id'] = \ - secret_id - return self.delete_secret_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if secret_id is not None: + _path_params['secretId'] = secret_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/secrets/{secretId}', + 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 retrieve_secret( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindSecretResponse: + """Get specific secret by id + + Get attributes values for a specific secret on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindSecretResponse", + } + 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 retrieve_secret_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindSecretResponse]: + """Get specific secret by id + + Get attributes values for a specific secret on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindSecretResponse", + } + 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 retrieve_secret_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific secret by id + + Get attributes values for a specific secret on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindSecretResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_secret_serialize( self, x_request_id, secret_id, - **kwargs - ): - """Get specific secret by id # noqa: E501 - - Get attributes values for a specific secret on your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_secret(x_request_id, secret_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - secret_id (int): The id of the secret - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindSecretResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['secret_id'] = \ - secret_id - return self.retrieve_secret_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if secret_id is not None: + _path_params['secretId'] = secret_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/secrets/{secretId}', + 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 retrieve_secret_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter secrets by name")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter secrets by type")] = 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, + ) -> ListSecretResponse: + """List secrets + + List and filter all secrets in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter secrets by name + :type name: str + :param type: Filter secrets by type + :type type: 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._retrieve_secret_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSecretResponse", + } + 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 retrieve_secret_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter secrets by name")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter secrets by type")] = 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[ListSecretResponse]: + """List secrets + + List and filter all secrets in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter secrets by name + :type name: str + :param type: Filter secrets by type + :type type: 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._retrieve_secret_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSecretResponse", + } + 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 retrieve_secret_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter secrets by name")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter secrets by type")] = 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 secrets + + List and filter all secrets in your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter secrets by name + :type name: str + :param type: Filter secrets by type + :type type: 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._retrieve_secret_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSecretResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_secret_list_serialize( self, x_request_id, - **kwargs - ): - """List secrets # noqa: E501 - - List and filter all secrets in your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_secret_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - name (str): Filter secrets by name. [optional] - type (str): Filter secrets by type. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListSecretResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_secret_list_endpoint.call_with_http_info(**kwargs) + x_trace_id, + page, + size, + order_by, + name, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if name is not None: + + _query_params.append(('name', name)) + + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/secrets', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def update_secret( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + update_secret_request: UpdateSecretRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UpdateSecretResponse: + """Update specific secret by id + + Update attributes to your secret. Attributes are optional. If not set, the attributes will retain their original values. Only name and value can be updated. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param update_secret_request: (required) + :type update_secret_request: UpdateSecretRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + update_secret_request=update_secret_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateSecretResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_secret_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + update_secret_request: UpdateSecretRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UpdateSecretResponse]: + """Update specific secret by id + + Update attributes to your secret. Attributes are optional. If not set, the attributes will retain their original values. Only name and value can be updated. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param update_secret_request: (required) + :type update_secret_request: UpdateSecretRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + update_secret_request=update_secret_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateSecretResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_secret_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + secret_id: Annotated[StrictInt, Field(description="The id of the secret")], + update_secret_request: UpdateSecretRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update specific secret by id + + Update attributes to your secret. Attributes are optional. If not set, the attributes will retain their original values. Only name and value can be updated. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param secret_id: The id of the secret (required) + :type secret_id: int + :param update_secret_request: (required) + :type update_secret_request: UpdateSecretRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_secret_serialize( + x_request_id=x_request_id, + secret_id=secret_id, + update_secret_request=update_secret_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateSecretResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_secret_serialize( self, x_request_id, secret_id, update_secret_request, - **kwargs - ): - """Update specific secret by id # noqa: E501 - - Update attributes to your secret. Attributes are optional. If not set, the attributes will retain their original values. Only name and value can be updated. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_secret(x_request_id, secret_id, update_secret_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - secret_id (int): The id of the secret - update_secret_request (UpdateSecretRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UpdateSecretResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['secret_id'] = \ - secret_id - kwargs['update_secret_request'] = \ - update_secret_request - return self.update_secret_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if secret_id is not None: + _path_params['secretId'] = secret_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if update_secret_request is not None: + _body_params = update_secret_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/secrets/{secretId}', + 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/pfruck_contabo/api/secrets_audits_api.py b/pfruck_contabo/api/secrets_audits_api.py index 32c9c27..efd95a8 100644 --- a/pfruck_contabo/api/secrets_audits_api.py +++ b/pfruck_contabo/api/secrets_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_secret_audit_response import ListSecretAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_secret_audit_response import ListSecretAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class SecretsAuditsApi(object): +class SecretsAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_secret_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListSecretAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/secrets/audits', - 'operation_id': 'retrieve_secret_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'secret_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'secret_id': - (int,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'secret_id': 'secretId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'secret_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_secret_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your secrets (audit) # noqa: E501 - - List and filters the history about your secrets. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_secret_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - secret_id (int): The id of the secret.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): changedBy of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListSecretAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + secret_id: Annotated[Optional[StrictInt], Field(description="The id of the secret.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListSecretAuditResponse: + """List history about your secrets (audit) + + List and filters the history about your secrets. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param secret_id: The id of the secret. + :type secret_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_secret_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + secret_id=secret_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSecretAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_secret_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + secret_id: Annotated[Optional[StrictInt], Field(description="The id of the secret.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListSecretAuditResponse]: + """List history about your secrets (audit) + + List and filters the history about your secrets. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param secret_id: The id of the secret. + :type secret_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_secret_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + secret_id=secret_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSecretAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_secret_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + secret_id: Annotated[Optional[StrictInt], Field(description="The id of the secret.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your secrets (audit) + + List and filters the history about your secrets. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param secret_id: The id of the secret. + :type secret_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_secret_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + secret_id=secret_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSecretAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_secret_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + secret_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if secret_id is not None: + + _query_params.append(('secretId', secret_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/secrets/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_secret_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/snapshots_api.py b/pfruck_contabo/api/snapshots_api.py index d984d4f..ce30e53 100644 --- a/pfruck_contabo/api/snapshots_api.py +++ b/pfruck_contabo/api/snapshots_api.py @@ -1,1082 +1,1980 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_snapshot_request import CreateSnapshotRequest -from pfruck_contabo.model.create_snapshot_response import CreateSnapshotResponse -from pfruck_contabo.model.find_snapshot_response import FindSnapshotResponse -from pfruck_contabo.model.list_snapshot_response import ListSnapshotResponse -from pfruck_contabo.model.rollback_snapshot_response import RollbackSnapshotResponse -from pfruck_contabo.model.update_snapshot_request import UpdateSnapshotRequest -from pfruck_contabo.model.update_snapshot_response import UpdateSnapshotResponse - - -class SnapshotsApi(object): +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Any, Dict, List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_snapshot_request import CreateSnapshotRequest +from pfruck_contabo.models.create_snapshot_response import CreateSnapshotResponse +from pfruck_contabo.models.find_snapshot_response import FindSnapshotResponse +from pfruck_contabo.models.list_snapshot_response import ListSnapshotResponse +from pfruck_contabo.models.rollback_snapshot_response import RollbackSnapshotResponse +from pfruck_contabo.models.update_snapshot_request import UpdateSnapshotRequest +from pfruck_contabo.models.update_snapshot_response import UpdateSnapshotResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class SnapshotsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_snapshot_endpoint = _Endpoint( - settings={ - 'response_type': (CreateSnapshotResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/snapshots', - 'operation_id': 'create_snapshot', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'create_snapshot_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'create_snapshot_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'create_snapshot_request': - (CreateSnapshotRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'create_snapshot_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + + @validate_call + def create_snapshot( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + create_snapshot_request: CreateSnapshotRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateSnapshotResponse: + """Create a new instance snapshot + + Create a new snapshot for instance, with name and description attributes + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param create_snapshot_request: (required) + :type create_snapshot_request: CreateSnapshotRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + create_snapshot_request=create_snapshot_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.delete_snapshot_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/snapshots/{snapshotId}', - 'operation_id': 'delete_snapshot', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'snapshot_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'snapshot_id': 'snapshotId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'snapshot_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.retrieve_snapshot_endpoint = _Endpoint( - settings={ - 'response_type': (FindSnapshotResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/snapshots/{snapshotId}', - 'operation_id': 'retrieve_snapshot', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'snapshot_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'snapshot_id': 'snapshotId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'snapshot_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_snapshot_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + create_snapshot_request: CreateSnapshotRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateSnapshotResponse]: + """Create a new instance snapshot + + Create a new snapshot for instance, with name and description attributes + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param create_snapshot_request: (required) + :type create_snapshot_request: CreateSnapshotRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + create_snapshot_request=create_snapshot_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - self.retrieve_snapshot_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListSnapshotResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/snapshots', - 'operation_id': 'retrieve_snapshot_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'name', - ], - 'required': [ - 'x_request_id', - 'instance_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'name': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'name': 'name', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'name': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - self.rollback_snapshot_endpoint = _Endpoint( - settings={ - 'response_type': (RollbackSnapshotResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/snapshots/{snapshotId}/rollback', - 'operation_id': 'rollback_snapshot', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - 'body', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - 'body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'snapshot_id': - (str,), - 'body': - ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'snapshot_id': 'snapshotId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'snapshot_id': 'path', - 'body': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - self.update_snapshot_endpoint = _Endpoint( - settings={ - 'response_type': (UpdateSnapshotResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/instances/{instanceId}/snapshots/{snapshotId}', - 'operation_id': 'update_snapshot', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - 'update_snapshot_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'instance_id', - 'snapshot_id', - 'update_snapshot_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'instance_id': - (int,), - 'snapshot_id': - (str,), - 'update_snapshot_request': - (UpdateSnapshotRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'instance_id': 'instanceId', - 'snapshot_id': 'snapshotId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'instance_id': 'path', - 'snapshot_id': 'path', - 'update_snapshot_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client + + + @validate_call + def create_snapshot_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + create_snapshot_request: CreateSnapshotRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new instance snapshot + + Create a new snapshot for instance, with name and description attributes + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param create_snapshot_request: (required) + :type create_snapshot_request: CreateSnapshotRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + create_snapshot_request=create_snapshot_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - def create_snapshot( + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_snapshot_serialize( self, x_request_id, instance_id, create_snapshot_request, - **kwargs - ): - """Create a new instance snapshot # noqa: E501 - - Create a new snapshot for instance, with name and description attributes # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_snapshot(x_request_id, instance_id, create_snapshot_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - create_snapshot_request (CreateSnapshotRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateSnapshotResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_snapshot_request is not None: + _body_params = create_snapshot_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/snapshots', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def delete_snapshot( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing snapshot by id + + Delete existing instance snapshot by id + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_snapshot_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete existing snapshot by id + + Delete existing instance snapshot by id + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def delete_snapshot_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing snapshot by id + + Delete existing instance snapshot by id + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['create_snapshot_request'] = \ - create_snapshot_request - return self.create_snapshot_endpoint.call_with_http_info(**kwargs) + return response_data.response - def delete_snapshot( + + def _delete_snapshot_serialize( self, x_request_id, instance_id, snapshot_id, - **kwargs - ): - """Delete existing snapshot by id # noqa: E501 - - Delete existing instance snapshot by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_snapshot(x_request_id, instance_id, snapshot_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - snapshot_id (str): The identifier of the snapshot - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + if snapshot_id is not None: + _path_params['snapshotId'] = snapshot_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/compute/instances/{instanceId}/snapshots/{snapshotId}', + 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 retrieve_snapshot( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindSnapshotResponse: + """Retrieve a specific snapshot by id + + Get all attributes for a specific snapshot + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_snapshot_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindSnapshotResponse]: + """Retrieve a specific snapshot by id + + Get all attributes for a specific snapshot + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_snapshot_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Retrieve a specific snapshot by id + + Get all attributes for a specific snapshot + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['snapshot_id'] = \ - snapshot_id - return self.delete_snapshot_endpoint.call_with_http_info(**kwargs) + return response_data.response - def retrieve_snapshot( + + def _retrieve_snapshot_serialize( self, x_request_id, instance_id, snapshot_id, - **kwargs - ): - """Retrieve a specific snapshot by id # noqa: E501 - - Get all attributes for a specific snapshot # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_snapshot(x_request_id, instance_id, snapshot_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - snapshot_id (str): The identifier of the snapshot - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindSnapshotResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + if snapshot_id is not None: + _path_params['snapshotId'] = snapshot_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/instances/{instanceId}/snapshots/{snapshotId}', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def retrieve_snapshot_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter as substring match for snapshots names.")] = 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, + ) -> ListSnapshotResponse: + """List snapshots + + List and filter all your snapshots for a specific instance + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter as substring match for snapshots names. + :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._retrieve_snapshot_list_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_snapshot_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter as substring match for snapshots names.")] = 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[ListSnapshotResponse]: + """List snapshots + + List and filter all your snapshots for a specific instance + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter as substring match for snapshots names. + :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._retrieve_snapshot_list_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['snapshot_id'] = \ - snapshot_id - return self.retrieve_snapshot_endpoint.call_with_http_info(**kwargs) - def retrieve_snapshot_list( + + @validate_call + def retrieve_snapshot_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter as substring match for snapshots names.")] = 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 snapshots + + List and filter all your snapshots for a specific instance + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter as substring match for snapshots names. + :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._retrieve_snapshot_list_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_snapshot_list_serialize( self, x_request_id, instance_id, - **kwargs - ): - """List snapshots # noqa: E501 - - List and filter all your snapshots for a specific instance # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_snapshot_list(x_request_id, instance_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - name (str): Filter as substring match for snapshots names.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListSnapshotResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + page, + size, + order_by, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if name is not None: + + _query_params.append(('name', name)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/instances/{instanceId}/snapshots', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def rollback_snapshot( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + body: Dict[str, Any], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> RollbackSnapshotResponse: + """Revert the instance to a particular snapshot based on its identifier + + Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param body: (required) + :type body: object + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rollback_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + body=body, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RollbackSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def rollback_snapshot_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + body: Dict[str, Any], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[RollbackSnapshotResponse]: + """Revert the instance to a particular snapshot based on its identifier + + Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param body: (required) + :type body: object + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rollback_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + body=body, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RollbackSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - return self.retrieve_snapshot_list_endpoint.call_with_http_info(**kwargs) - def rollback_snapshot( + + @validate_call + def rollback_snapshot_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + body: Dict[str, Any], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Revert the instance to a particular snapshot based on its identifier + + Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param body: (required) + :type body: object + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rollback_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + body=body, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RollbackSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rollback_snapshot_serialize( self, x_request_id, instance_id, snapshot_id, body, - **kwargs - ): - """Revert the instance to a particular snapshot based on its identifier # noqa: E501 - - Rollback instance to a specific snapshot. The snapshot must be the latest one in order to be able to restore it, otherwise you will receive an error informing you that the snapshot is not the latest # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.rollback_snapshot(x_request_id, instance_id, snapshot_id, body, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - snapshot_id (str): The identifier of the snapshot - body ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - RollbackSnapshotResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + if snapshot_id is not None: + _path_params['snapshotId'] = snapshot_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/compute/instances/{instanceId}/snapshots/{snapshotId}/rollback', + 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 ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + + + + + @validate_call + def update_snapshot( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + update_snapshot_request: UpdateSnapshotRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UpdateSnapshotResponse: + """Update specific snapshot by id + + Update attributes of a snapshot. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param update_snapshot_request: (required) + :type update_snapshot_request: UpdateSnapshotRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + update_snapshot_request=update_snapshot_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_snapshot_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + update_snapshot_request: UpdateSnapshotRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UpdateSnapshotResponse]: + """Update specific snapshot by id + + Update attributes of a snapshot. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param update_snapshot_request: (required) + :type update_snapshot_request: UpdateSnapshotRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + update_snapshot_request=update_snapshot_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['snapshot_id'] = \ - snapshot_id - kwargs['body'] = \ - body - return self.rollback_snapshot_endpoint.call_with_http_info(**kwargs) - def update_snapshot( + + @validate_call + def update_snapshot_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + instance_id: Annotated[StrictInt, Field(description="The identifier of the instance")], + snapshot_id: Annotated[StrictStr, Field(description="The identifier of the snapshot")], + update_snapshot_request: UpdateSnapshotRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update specific snapshot by id + + Update attributes of a snapshot. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param instance_id: The identifier of the instance (required) + :type instance_id: int + :param snapshot_id: The identifier of the snapshot (required) + :type snapshot_id: str + :param update_snapshot_request: (required) + :type update_snapshot_request: UpdateSnapshotRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_snapshot_serialize( + x_request_id=x_request_id, + instance_id=instance_id, + snapshot_id=snapshot_id, + update_snapshot_request=update_snapshot_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateSnapshotResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_snapshot_serialize( self, x_request_id, instance_id, snapshot_id, update_snapshot_request, - **kwargs - ): - """Update specific snapshot by id # noqa: E501 - - Update attributes of a snapshot. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_snapshot(x_request_id, instance_id, snapshot_id, update_snapshot_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - instance_id (int): The identifier of the instance - snapshot_id (str): The identifier of the snapshot - update_snapshot_request (UpdateSnapshotRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UpdateSnapshotResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params['instanceId'] = instance_id + if snapshot_id is not None: + _path_params['snapshotId'] = snapshot_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if update_snapshot_request is not None: + _body_params = update_snapshot_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + # 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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/compute/instances/{instanceId}/snapshots/{snapshotId}', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['instance_id'] = \ - instance_id - kwargs['snapshot_id'] = \ - snapshot_id - kwargs['update_snapshot_request'] = \ - update_snapshot_request - return self.update_snapshot_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/snapshots_audits_api.py b/pfruck_contabo/api/snapshots_audits_api.py index 6e2ca9a..6554301 100644 --- a/pfruck_contabo/api/snapshots_audits_api.py +++ b/pfruck_contabo/api/snapshots_audits_api.py @@ -1,240 +1,485 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_snapshots_audit_response import ListSnapshotsAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_snapshots_audit_response import ListSnapshotsAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class SnapshotsAuditsApi(object): +class SnapshotsAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_snapshots_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListSnapshotsAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/compute/snapshots/audits', - 'operation_id': 'retrieve_snapshots_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'instance_id', - 'snapshot_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'instance_id': - (int,), - 'snapshot_id': - (str,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'instance_id': 'instanceId', - 'snapshot_id': 'snapshotId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'instance_id': 'query', - 'snapshot_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_snapshots_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your snapshots (audit) triggered via the API # noqa: E501 - - List and filters the history about your snapshots your triggered via the API. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_snapshots_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - instance_id (int): The identifier of the instance. [optional] - snapshot_id (str): The identifier of the snapshot. [optional] - request_id (str): The requestId of the API call which led to the change. [optional] - changed_by (str): changedBy of the user which led to the change. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListSnapshotsAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instance")] = None, + snapshot_id: Annotated[Optional[StrictStr], Field(description="The identifier of the snapshot")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListSnapshotsAuditResponse: + """List history about your snapshots (audit) triggered via the API + + List and filters the history about your snapshots your triggered via the API. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instance + :type instance_id: int + :param snapshot_id: The identifier of the snapshot + :type snapshot_id: str + :param request_id: The requestId of the API call which led to the change + :type request_id: str + :param changed_by: changedBy of the user which led to the change + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_snapshots_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + snapshot_id=snapshot_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSnapshotsAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_snapshots_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instance")] = None, + snapshot_id: Annotated[Optional[StrictStr], Field(description="The identifier of the snapshot")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListSnapshotsAuditResponse]: + """List history about your snapshots (audit) triggered via the API + + List and filters the history about your snapshots your triggered via the API. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instance + :type instance_id: int + :param snapshot_id: The identifier of the snapshot + :type snapshot_id: str + :param request_id: The requestId of the API call which led to the change + :type request_id: str + :param changed_by: changedBy of the user which led to the change + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_snapshots_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + snapshot_id=snapshot_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSnapshotsAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_snapshots_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + instance_id: Annotated[Optional[StrictInt], Field(description="The identifier of the instance")] = None, + snapshot_id: Annotated[Optional[StrictStr], Field(description="The identifier of the snapshot")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your snapshots (audit) triggered via the API + + List and filters the history about your snapshots your triggered via the API. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param instance_id: The identifier of the instance + :type instance_id: int + :param snapshot_id: The identifier of the snapshot + :type snapshot_id: str + :param request_id: The requestId of the API call which led to the change + :type request_id: str + :param changed_by: changedBy of the user which led to the change + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_snapshots_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + instance_id=instance_id, + snapshot_id=snapshot_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSnapshotsAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_snapshots_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + instance_id, + snapshot_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if instance_id is not None: + + _query_params.append(('instanceId', instance_id)) + + if snapshot_id is not None: + + _query_params.append(('snapshotId', snapshot_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/compute/snapshots/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_snapshots_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/tag_assignments_api.py b/pfruck_contabo/api/tag_assignments_api.py index 120464c..4fc5432 100644 --- a/pfruck_contabo/api/tag_assignments_api.py +++ b/pfruck_contabo/api/tag_assignments_api.py @@ -1,751 +1,1346 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_assignment_response import CreateAssignmentResponse +from pfruck_contabo.models.find_assignment_response import FindAssignmentResponse +from pfruck_contabo.models.list_assignment_response import ListAssignmentResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_assignment_response import CreateAssignmentResponse -from pfruck_contabo.model.find_assignment_response import FindAssignmentResponse -from pfruck_contabo.model.list_assignment_response import ListAssignmentResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class TagAssignmentsApi(object): +class TagAssignmentsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_assignment_endpoint = _Endpoint( - settings={ - 'response_type': (CreateAssignmentResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}', - 'operation_id': 'create_assignment', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'tag_id', - 'resource_type', - 'resource_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'tag_id', - 'resource_type', - 'resource_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'tag_id': - (int,), - 'resource_type': - (str,), - 'resource_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'tag_id': 'tagId', - 'resource_type': 'resourceType', - 'resource_id': 'resourceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'tag_id': 'path', - 'resource_type': 'path', - 'resource_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.delete_assignment_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}', - 'operation_id': 'delete_assignment', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'tag_id', - 'resource_type', - 'resource_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'tag_id', - 'resource_type', - 'resource_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'tag_id': - (int,), - 'resource_type': - (str,), - 'resource_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'tag_id': 'tagId', - 'resource_type': 'resourceType', - 'resource_id': 'resourceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'tag_id': 'path', - 'resource_type': 'path', - 'resource_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_assignment_endpoint = _Endpoint( - settings={ - 'response_type': (FindAssignmentResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}', - 'operation_id': 'retrieve_assignment', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'tag_id', - 'resource_type', - 'resource_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'tag_id', - 'resource_type', - 'resource_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'tag_id': - (int,), - 'resource_type': - (str,), - 'resource_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'tag_id': 'tagId', - 'resource_type': 'resourceType', - 'resource_id': 'resourceId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'tag_id': 'path', - 'resource_type': 'path', - 'resource_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_assignment_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListAssignmentResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/{tagId}/assignments', - 'operation_id': 'retrieve_assignment_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'tag_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'resource_type', - ], - 'required': [ - 'x_request_id', - 'tag_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'tag_id': - (int,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'resource_type': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'tag_id': 'tagId', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'resource_type': 'resourceType', - }, - 'location_map': { - 'x_request_id': 'header', - 'tag_id': 'path', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'resource_type': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def create_assignment( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateAssignmentResponse: + """Create a new assignment for the tag + + Create a new tag assignment. This marks the specified resource with the specified tag for organizing purposes or to restrict access to that resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAssignmentResponse", + } + 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_assignment_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateAssignmentResponse]: + """Create a new assignment for the tag + + Create a new tag assignment. This marks the specified resource with the specified tag for organizing purposes or to restrict access to that resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAssignmentResponse", + } + 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_assignment_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new assignment for the tag + + Create a new tag assignment. This marks the specified resource with the specified tag for organizing purposes or to restrict access to that resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateAssignmentResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_assignment_serialize( self, x_request_id, tag_id, resource_type, resource_id, - **kwargs - ): - """Create a new assignment for the tag # noqa: E501 - - Create a new tag assignment. This marks the specified resource with the specified tag for organizing purposes or to restrict access to that resource. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_assignment(x_request_id, tag_id, resource_type, resource_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - tag_id (int): The identifier of the tag. - resource_type (str): The identifier of the resource type. Resource type is one of `instance|image|object-storage`. - resource_id (str): The identifier of the resource id - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateAssignmentResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['tag_id'] = \ - tag_id - kwargs['resource_type'] = \ - resource_type - kwargs['resource_id'] = \ - resource_id - return self.create_assignment_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tag_id is not None: + _path_params['tagId'] = tag_id + if resource_type is not None: + _path_params['resourceType'] = resource_type + if resource_id is not None: + _path_params['resourceId'] = resource_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}', + 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_assignment( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing tag assignment + + Tag assignment will be removed from the specified resource. If this tag is being used for access restrictions the affected users will no longer be able to access that resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_assignment_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete existing tag assignment + + Tag assignment will be removed from the specified resource. If this tag is being used for access restrictions the affected users will no longer be able to access that resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_assignment_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing tag assignment + + Tag assignment will be removed from the specified resource. If this tag is being used for access restrictions the affected users will no longer be able to access that resource. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_assignment_serialize( self, x_request_id, tag_id, resource_type, resource_id, - **kwargs - ): - """Delete existing tag assignment # noqa: E501 - - Tag assignment will be removed from the specified resource. If this tag is being used for access restrictions the affected users will no longer be able to access that resource. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_assignment(x_request_id, tag_id, resource_type, resource_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - tag_id (int): The identifier of the tag. - resource_type (str): The identifier of the resource type. Resource type is one of `instance|image|object-storage`. - resource_id (str): The identifier of the resource id - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['tag_id'] = \ - tag_id - kwargs['resource_type'] = \ - resource_type - kwargs['resource_id'] = \ - resource_id - return self.delete_assignment_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tag_id is not None: + _path_params['tagId'] = tag_id + if resource_type is not None: + _path_params['resourceType'] = resource_type + if resource_id is not None: + _path_params['resourceId'] = resource_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}', + 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 retrieve_assignment( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindAssignmentResponse: + """Get specific assignment for the tag + + Get attributes for a specific tag assignment in your account. For this the resource type and resource id is required. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindAssignmentResponse", + } + 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 retrieve_assignment_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindAssignmentResponse]: + """Get specific assignment for the tag + + Get attributes for a specific tag assignment in your account. For this the resource type and resource id is required. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindAssignmentResponse", + } + 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 retrieve_assignment_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + resource_type: Annotated[StrictStr, Field(description="The identifier of the resource type. Resource type is one of `instance|image|object-storage`.")], + resource_id: Annotated[StrictStr, Field(description="The identifier of the resource id")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific assignment for the tag + + Get attributes for a specific tag assignment in your account. For this the resource type and resource id is required. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param resource_type: The identifier of the resource type. Resource type is one of `instance|image|object-storage`. (required) + :type resource_type: str + :param resource_id: The identifier of the resource id (required) + :type resource_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_assignment_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + resource_type=resource_type, + resource_id=resource_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindAssignmentResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_assignment_serialize( self, x_request_id, tag_id, resource_type, resource_id, - **kwargs - ): - """Get specific assignment for the tag # noqa: E501 - - Get attributes for a specific tag assignment in your account. For this the resource type and resource id is required. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_assignment(x_request_id, tag_id, resource_type, resource_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - tag_id (int): The identifier of the tag. - resource_type (str): The identifier of the resource type. Resource type is one of `instance|image|object-storage`. - resource_id (str): The identifier of the resource id - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindAssignmentResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['tag_id'] = \ - tag_id - kwargs['resource_type'] = \ - resource_type - kwargs['resource_id'] = \ - resource_id - return self.retrieve_assignment_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tag_id is not None: + _path_params['tagId'] = tag_id + if resource_type is not None: + _path_params['resourceType'] = resource_type + if resource_id is not None: + _path_params['resourceId'] = resource_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/tags/{tagId}/assignments/{resourceType}/{resourceId}', + 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 retrieve_assignment_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + resource_type: Annotated[Optional[StrictStr], Field(description="Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`.")] = 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, + ) -> ListAssignmentResponse: + """List tag assignments + + List and filter all existing assignments for a tag in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param resource_type: Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`. + :type resource_type: 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._retrieve_assignment_list_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + resource_type=resource_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAssignmentResponse", + } + 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 retrieve_assignment_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + resource_type: Annotated[Optional[StrictStr], Field(description="Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`.")] = 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[ListAssignmentResponse]: + """List tag assignments + + List and filter all existing assignments for a tag in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param resource_type: Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`. + :type resource_type: 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._retrieve_assignment_list_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + resource_type=resource_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAssignmentResponse", + } + 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 retrieve_assignment_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + resource_type: Annotated[Optional[StrictStr], Field(description="Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`.")] = 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 tag assignments + + List and filter all existing assignments for a tag in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag. (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param resource_type: Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`. + :type resource_type: 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._retrieve_assignment_list_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + resource_type=resource_type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAssignmentResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_assignment_list_serialize( self, x_request_id, tag_id, - **kwargs - ): - """List tag assignments # noqa: E501 - - List and filter all existing assignments for a tag in your account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_assignment_list(x_request_id, tag_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - tag_id (int): The identifier of the tag. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - resource_type (str): Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListAssignmentResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['tag_id'] = \ - tag_id - return self.retrieve_assignment_list_endpoint.call_with_http_info(**kwargs) + x_trace_id, + page, + size, + order_by, + resource_type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tag_id is not None: + _path_params['tagId'] = tag_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if resource_type is not None: + + _query_params.append(('resourceType', resource_type)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/tags/{tagId}/assignments', + 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/pfruck_contabo/api/tag_assignments_audits_api.py b/pfruck_contabo/api/tag_assignments_audits_api.py index 1a4af26..bbc0a08 100644 --- a/pfruck_contabo/api/tag_assignments_audits_api.py +++ b/pfruck_contabo/api/tag_assignments_audits_api.py @@ -1,240 +1,485 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_assignment_audits_response import ListAssignmentAuditsResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_assignment_audits_response import ListAssignmentAuditsResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class TagAssignmentsAuditsApi(object): +class TagAssignmentsAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_assignments_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListAssignmentAuditsResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/assignments/audits', - 'operation_id': 'retrieve_assignments_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'tag_id', - 'resource_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'tag_id': - (int,), - 'resource_id': - (str,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'tag_id': 'tagId', - 'resource_id': 'resourceId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'tag_id': 'query', - 'resource_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_assignments_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your assignments (audit) # noqa: E501 - - List and filters the history about your assignments. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_assignments_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - tag_id (int): The identifier of the tag.. [optional] - resource_id (str): The identifier of the resource.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): UserId of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListAssignmentAuditsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + tag_id: Annotated[Optional[StrictInt], Field(description="The identifier of the tag.")] = None, + resource_id: Annotated[Optional[StrictStr], Field(description="The identifier of the resource.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListAssignmentAuditsResponse: + """List history about your assignments (audit) + + List and filters the history about your assignments. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param tag_id: The identifier of the tag. + :type tag_id: int + :param resource_id: The identifier of the resource. + :type resource_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_assignments_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + tag_id=tag_id, + resource_id=resource_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAssignmentAuditsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_assignments_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + tag_id: Annotated[Optional[StrictInt], Field(description="The identifier of the tag.")] = None, + resource_id: Annotated[Optional[StrictStr], Field(description="The identifier of the resource.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListAssignmentAuditsResponse]: + """List history about your assignments (audit) + + List and filters the history about your assignments. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param tag_id: The identifier of the tag. + :type tag_id: int + :param resource_id: The identifier of the resource. + :type resource_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_assignments_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + tag_id=tag_id, + resource_id=resource_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAssignmentAuditsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_assignments_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + tag_id: Annotated[Optional[StrictInt], Field(description="The identifier of the tag.")] = None, + resource_id: Annotated[Optional[StrictStr], Field(description="The identifier of the resource.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your assignments (audit) + + List and filters the history about your assignments. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param tag_id: The identifier of the tag. + :type tag_id: int + :param resource_id: The identifier of the resource. + :type resource_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_assignments_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + tag_id=tag_id, + resource_id=resource_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListAssignmentAuditsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_assignments_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + tag_id, + resource_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if tag_id is not None: + + _query_params.append(('tagId', tag_id)) + + if resource_id is not None: + + _query_params.append(('resourceId', resource_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/tags/assignments/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_assignments_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/tags_api.py b/pfruck_contabo/api/tags_api.py index 03f537d..a41606b 100644 --- a/pfruck_contabo/api/tags_api.py +++ b/pfruck_contabo/api/tags_api.py @@ -1,853 +1,1573 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_tag_request import CreateTagRequest +from pfruck_contabo.models.create_tag_response import CreateTagResponse +from pfruck_contabo.models.find_tag_response import FindTagResponse +from pfruck_contabo.models.list_tag_response import ListTagResponse +from pfruck_contabo.models.update_tag_request import UpdateTagRequest +from pfruck_contabo.models.update_tag_response import UpdateTagResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_tag_request import CreateTagRequest -from pfruck_contabo.model.create_tag_response import CreateTagResponse -from pfruck_contabo.model.find_tag_response import FindTagResponse -from pfruck_contabo.model.list_tag_response import ListTagResponse -from pfruck_contabo.model.update_tag_request import UpdateTagRequest -from pfruck_contabo.model.update_tag_response import UpdateTagResponse - - -class TagsApi(object): +class TagsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_tag_endpoint = _Endpoint( - settings={ - 'response_type': (CreateTagResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags', - 'operation_id': 'create_tag', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_tag_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_tag_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_tag_request': - (CreateTagRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_tag_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.delete_tag_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/{tagId}', - 'operation_id': 'delete_tag', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'tag_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'tag_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'tag_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'tag_id': 'tagId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'tag_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_tag_endpoint = _Endpoint( - settings={ - 'response_type': (FindTagResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/{tagId}', - 'operation_id': 'retrieve_tag', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'tag_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'tag_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'tag_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'tag_id': 'tagId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'tag_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_tag_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListTagResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags', - 'operation_id': 'retrieve_tag_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'name', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'name': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'name': 'name', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'name': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_tag_endpoint = _Endpoint( - settings={ - 'response_type': (UpdateTagResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/{tagId}', - 'operation_id': 'update_tag', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'tag_id', - 'update_tag_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'tag_id', - 'update_tag_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'tag_id': - (int,), - 'update_tag_request': - (UpdateTagRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'tag_id': 'tagId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'tag_id': 'path', - 'update_tag_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def create_tag( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_tag_request: CreateTagRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateTagResponse: + """Create a new tag + + Create a new tag in your account with attribute name and optional attribute color. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_tag_request: (required) + :type create_tag_request: CreateTagRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_tag_serialize( + x_request_id=x_request_id, + create_tag_request=create_tag_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateTagResponse", + } + 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_tag_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_tag_request: CreateTagRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateTagResponse]: + """Create a new tag + + Create a new tag in your account with attribute name and optional attribute color. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_tag_request: (required) + :type create_tag_request: CreateTagRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_tag_serialize( + x_request_id=x_request_id, + create_tag_request=create_tag_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateTagResponse", + } + 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_tag_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_tag_request: CreateTagRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new tag + + Create a new tag in your account with attribute name and optional attribute color. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_tag_request: (required) + :type create_tag_request: CreateTagRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_tag_serialize( + x_request_id=x_request_id, + create_tag_request=create_tag_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateTagResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_tag_serialize( self, x_request_id, create_tag_request, - **kwargs - ): - """Create a new tag # noqa: E501 - - Create a new tag in your account with attribute name and optional attribute color. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_tag(x_request_id, create_tag_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_tag_request (CreateTagRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateTagResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_tag_request'] = \ - create_tag_request - return self.create_tag_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_tag_request is not None: + _body_params = create_tag_request + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/tags', + 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_tag( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing tag by id + + Your tag can be deleted if it is not assigned to any resource on your account. Check tag assigments before deleting tag. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_tag_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete existing tag by id + + Your tag can be deleted if it is not assigned to any resource on your account. Check tag assigments before deleting tag. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_tag_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing tag by id + + Your tag can be deleted if it is not assigned to any resource on your account. Check tag assigments before deleting tag. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_tag_serialize( self, x_request_id, tag_id, - **kwargs - ): - """Delete existing tag by id # noqa: E501 - - Your tag can be deleted if it is not assigned to any resource on your account. Check tag assigments before deleting tag. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_tag(x_request_id, tag_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - tag_id (int): The identifier of the tag - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['tag_id'] = \ - tag_id - return self.delete_tag_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tag_id is not None: + _path_params['tagId'] = tag_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/tags/{tagId}', + 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 retrieve_tag( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindTagResponse: + """Get specific tag by id + + Get attributes values to a specific tag on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindTagResponse", + } + 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 retrieve_tag_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindTagResponse]: + """Get specific tag by id + + Get attributes values to a specific tag on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindTagResponse", + } + 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 retrieve_tag_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific tag by id + + Get attributes values to a specific tag on your account. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindTagResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_tag_serialize( self, x_request_id, tag_id, - **kwargs - ): - """Get specific tag by id # noqa: E501 - - Get attributes values to a specific tag on your account. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_tag(x_request_id, tag_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - tag_id (int): The identifier of the tag - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindTagResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['tag_id'] = \ - tag_id - return self.retrieve_tag_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tag_id is not None: + _path_params['tagId'] = tag_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/tags/{tagId}', + 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 retrieve_tag_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag.")] = 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, + ) -> ListTagResponse: + """List tags + + List and filter all tags in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. + :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._retrieve_tag_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListTagResponse", + } + 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 retrieve_tag_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag.")] = 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[ListTagResponse]: + """List tags + + List and filter all tags in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. + :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._retrieve_tag_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListTagResponse", + } + 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 retrieve_tag_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + name: Annotated[Optional[StrictStr], Field(description="Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag.")] = 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 tags + + List and filter all tags in your account + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param name: Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. + :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._retrieve_tag_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListTagResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_tag_list_serialize( self, x_request_id, - **kwargs - ): - """List tags # noqa: E501 - - List and filter all tags in your account # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_tag_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - name (str): Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListTagResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_tag_list_endpoint.call_with_http_info(**kwargs) + x_trace_id, + page, + size, + order_by, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if name is not None: + + _query_params.append(('name', name)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/tags', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def update_tag( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + update_tag_request: UpdateTagRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UpdateTagResponse: + """Update specific tag by id + + Update attributes to your tag. Attributes are optional. If not set, the attributes will retain their original values. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param update_tag_request: (required) + :type update_tag_request: UpdateTagRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + update_tag_request=update_tag_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateTagResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_tag_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + update_tag_request: UpdateTagRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UpdateTagResponse]: + """Update specific tag by id + + Update attributes to your tag. Attributes are optional. If not set, the attributes will retain their original values. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param update_tag_request: (required) + :type update_tag_request: UpdateTagRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + update_tag_request=update_tag_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateTagResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_tag_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + tag_id: Annotated[StrictInt, Field(description="The identifier of the tag")], + update_tag_request: UpdateTagRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update specific tag by id + + Update attributes to your tag. Attributes are optional. If not set, the attributes will retain their original values. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param tag_id: The identifier of the tag (required) + :type tag_id: int + :param update_tag_request: (required) + :type update_tag_request: UpdateTagRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_tag_serialize( + x_request_id=x_request_id, + tag_id=tag_id, + update_tag_request=update_tag_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateTagResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_tag_serialize( self, x_request_id, tag_id, update_tag_request, - **kwargs - ): - """Update specific tag by id # noqa: E501 - - Update attributes to your tag. Attributes are optional. If not set, the attributes will retain their original values. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_tag(x_request_id, tag_id, update_tag_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - tag_id (int): The identifier of the tag - update_tag_request (UpdateTagRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UpdateTagResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['tag_id'] = \ - tag_id - kwargs['update_tag_request'] = \ - update_tag_request - return self.update_tag_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if tag_id is not None: + _path_params['tagId'] = tag_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if update_tag_request is not None: + _body_params = update_tag_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/tags/{tagId}', + 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/pfruck_contabo/api/tags_audits_api.py b/pfruck_contabo/api/tags_audits_api.py index 5ada50b..d436afe 100644 --- a/pfruck_contabo/api/tags_audits_api.py +++ b/pfruck_contabo/api/tags_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_tag_audits_response import ListTagAuditsResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_tag_audits_response import ListTagAuditsResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class TagsAuditsApi(object): +class TagsAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_tag_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListTagAuditsResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/tags/audits', - 'operation_id': 'retrieve_tag_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'tag_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'tag_id': - (int,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'tag_id': 'tagId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'tag_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_tag_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your assignments (audit) # noqa: E501 - - List and filters the history about your assignments. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_tag_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - tag_id (int): The identifier of the tag.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): UserId of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListTagAuditsResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + tag_id: Annotated[Optional[StrictInt], Field(description="The identifier of the tag.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListTagAuditsResponse: + """List history about your assignments (audit) + + List and filters the history about your assignments. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param tag_id: The identifier of the tag. + :type tag_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_tag_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + tag_id=tag_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListTagAuditsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_tag_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + tag_id: Annotated[Optional[StrictInt], Field(description="The identifier of the tag.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListTagAuditsResponse]: + """List history about your assignments (audit) + + List and filters the history about your assignments. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param tag_id: The identifier of the tag. + :type tag_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_tag_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + tag_id=tag_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListTagAuditsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_tag_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + tag_id: Annotated[Optional[StrictInt], Field(description="The identifier of the tag.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="UserId of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your assignments (audit) + + List and filters the history about your assignments. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param tag_id: The identifier of the tag. + :type tag_id: int + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: UserId of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_tag_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + tag_id=tag_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListTagAuditsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_tag_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + tag_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if tag_id is not None: + + _query_params.append(('tagId', tag_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/tags/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_tag_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api/users_api.py b/pfruck_contabo/api/users_api.py index 30dd606..eb0e071 100644 --- a/pfruck_contabo/api/users_api.py +++ b/pfruck_contabo/api/users_api.py @@ -1,2033 +1,3782 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" - + Generated by OpenAPI Generator (https://openapi-generator.tech) -import re # noqa: F401 -import sys # noqa: F401 - -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.create_user_request import CreateUserRequest -from pfruck_contabo.model.create_user_response import CreateUserResponse -from pfruck_contabo.model.find_client_response import FindClientResponse -from pfruck_contabo.model.find_credential_response import FindCredentialResponse -from pfruck_contabo.model.find_user_response import FindUserResponse -from pfruck_contabo.model.generate_client_secret_response import GenerateClientSecretResponse -from pfruck_contabo.model.list_credential_response import ListCredentialResponse -from pfruck_contabo.model.list_user_response import ListUserResponse -from pfruck_contabo.model.update_user_request import UpdateUserRequest -from pfruck_contabo.model.update_user_response import UpdateUserResponse - - -class UsersApi(object): + 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, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.create_user_request import CreateUserRequest +from pfruck_contabo.models.create_user_response import CreateUserResponse +from pfruck_contabo.models.find_client_response import FindClientResponse +from pfruck_contabo.models.find_credential_response import FindCredentialResponse +from pfruck_contabo.models.find_user_response import FindUserResponse +from pfruck_contabo.models.generate_client_secret_response import GenerateClientSecretResponse +from pfruck_contabo.models.list_credential_response import ListCredentialResponse +from pfruck_contabo.models.list_user_response import ListUserResponse +from pfruck_contabo.models.update_user_request import UpdateUserRequest +from pfruck_contabo.models.update_user_response import UpdateUserResponse + +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType + + +class UsersApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.create_user_endpoint = _Endpoint( - settings={ - 'response_type': (CreateUserResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users', - 'operation_id': 'create_user', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'create_user_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'create_user_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'create_user_request': - (CreateUserRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'create_user_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) - self.delete_user_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}', - 'operation_id': 'delete_user', - 'http_method': 'DELETE', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'user_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.generate_client_secret_endpoint = _Endpoint( - settings={ - 'response_type': (GenerateClientSecretResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/client/secret', - 'operation_id': 'generate_client_secret', - 'http_method': 'PUT', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.get_object_storage_credentials_endpoint = _Endpoint( - settings={ - 'response_type': (FindCredentialResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId}', - 'operation_id': 'get_object_storage_credentials', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'object_storage_id', - 'credential_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'user_id', - 'object_storage_id', - 'credential_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'object_storage_id': - (str,), - 'credential_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'object_storage_id': 'objectStorageId', - 'credential_id': 'credentialId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'object_storage_id': 'path', - 'credential_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.list_object_storage_credentials_endpoint = _Endpoint( - settings={ - 'response_type': (ListCredentialResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}/object-storages/credentials', - 'operation_id': 'list_object_storage_credentials', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'object_storage_id', - 'region_name', - 'display_name', - ], - 'required': [ - 'x_request_id', - 'user_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'object_storage_id': - (str,), - 'region_name': - (str,), - 'display_name': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'object_storage_id': 'objectStorageId', - 'region_name': 'regionName', - 'display_name': 'displayName', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'object_storage_id': 'query', - 'region_name': 'query', - 'display_name': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.regenerate_object_storage_credentials_endpoint = _Endpoint( - settings={ - 'response_type': (FindCredentialResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId}', - 'operation_id': 'regenerate_object_storage_credentials', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'object_storage_id', - 'credential_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'user_id', - 'object_storage_id', - 'credential_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'object_storage_id': - (str,), - 'credential_id': - (int,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'object_storage_id': 'objectStorageId', - 'credential_id': 'credentialId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'object_storage_id': 'path', - 'credential_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.resend_email_verification_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}/resend-email-verification', - 'operation_id': 'resend_email_verification', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'x_trace_id', - 'redirect_url', - ], - 'required': [ - 'x_request_id', - 'user_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'x_trace_id': - (str,), - 'redirect_url': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'x_trace_id': 'x-trace-id', - 'redirect_url': 'redirectUrl', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'x_trace_id': 'header', - 'redirect_url': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.reset_password_endpoint = _Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}/reset-password', - 'operation_id': 'reset_password', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'x_trace_id', - 'redirect_url', - ], - 'required': [ - 'x_request_id', - 'user_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'x_trace_id': - (str,), - 'redirect_url': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'x_trace_id': 'x-trace-id', - 'redirect_url': 'redirectUrl', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'x_trace_id': 'header', - 'redirect_url': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_user_endpoint = _Endpoint( - settings={ - 'response_type': (FindUserResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}', - 'operation_id': 'retrieve_user', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'user_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_user_client_endpoint = _Endpoint( - settings={ - 'response_type': (FindClientResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/client', - 'operation_id': 'retrieve_user_client', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.retrieve_user_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListUserResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users', - 'operation_id': 'retrieve_user_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'email', - 'enabled', - 'owner', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'email': - (str,), - 'enabled': - (bool,), - 'owner': - (bool,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'email': 'email', - 'enabled': 'enabled', - 'owner': 'owner', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'email': 'query', - 'enabled': 'query', - 'owner': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) - self.update_user_endpoint = _Endpoint( - settings={ - 'response_type': (UpdateUserResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/{userId}', - 'operation_id': 'update_user', - 'http_method': 'PATCH', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'user_id', - 'update_user_request', - 'x_trace_id', - ], - 'required': [ - 'x_request_id', - 'user_id', - 'update_user_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'user_id': - (str,), - 'update_user_request': - (UpdateUserRequest,), - 'x_trace_id': - (str,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'user_id': 'userId', - 'x_trace_id': 'x-trace-id', - }, - 'location_map': { - 'x_request_id': 'header', - 'user_id': 'path', - 'update_user_request': 'body', - 'x_trace_id': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client - ) + + @validate_call def create_user( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_user_request: CreateUserRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> CreateUserResponse: + """Create a new user + + Create a new user with required attributes name, email, enabled, totp (=Two-factor authentication 2FA), admin (=access to all endpoints and resources), accessAllResources and roles. You can't specify any password / secrets for the user. For security reasons the user will have to specify secrets on his own. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_user_request: (required) + :type create_user_request: CreateUserRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + x_request_id=x_request_id, + create_user_request=create_user_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateUserResponse", + } + 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_user_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_user_request: CreateUserRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[CreateUserResponse]: + """Create a new user + + Create a new user with required attributes name, email, enabled, totp (=Two-factor authentication 2FA), admin (=access to all endpoints and resources), accessAllResources and roles. You can't specify any password / secrets for the user. For security reasons the user will have to specify secrets on his own. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_user_request: (required) + :type create_user_request: CreateUserRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + x_request_id=x_request_id, + create_user_request=create_user_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateUserResponse", + } + 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_user_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + create_user_request: CreateUserRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Create a new user + + Create a new user with required attributes name, email, enabled, totp (=Two-factor authentication 2FA), admin (=access to all endpoints and resources), accessAllResources and roles. You can't specify any password / secrets for the user. For security reasons the user will have to specify secrets on his own. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param create_user_request: (required) + :type create_user_request: CreateUserRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + x_request_id=x_request_id, + create_user_request=create_user_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateUserResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_user_serialize( self, x_request_id, create_user_request, - **kwargs - ): - """Create a new user # noqa: E501 - - Create a new user with required attributes name, email, enabled, totp (=Two-factor authentication 2FA), admin (=access to all endpoints and resources), accessAllResources and roles. You can't specify any password / secrets for the user. For security reasons the user will have to specify secrets on his own. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user(x_request_id, create_user_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_user_request (CreateUserRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - CreateUserResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['create_user_request'] = \ - create_user_request - return self.create_user_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if create_user_request is not None: + _body_params = create_user_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/users', + 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_user( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing user by id + + By deleting a user he will not be able to access any endpoints or resources any longer. In order to temporarily disable a user please update its `enabled` attribute. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_user_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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]: + """Delete existing user by id + + By deleting a user he will not be able to access any endpoints or resources any longer. In order to temporarily disable a user please update its `enabled` attribute. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 delete_user_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Delete existing user by id + + By deleting a user he will not be able to access any endpoints or resources any longer. In order to temporarily disable a user please update its `enabled` attribute. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_user_serialize( self, x_request_id, user_id, - **kwargs - ): - """Delete existing user by id # noqa: E501 - - By deleting a user he will not be able to access any endpoints or resources any longer. In order to temporarily disable a user please update its `enabled` attribute. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user(x_request_id, user_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - return self.delete_user_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/v1/users/{userId}', + 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 generate_client_secret( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> GenerateClientSecretResponse: + """Generate new client secret + + Generate and get new client secret. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_client_secret_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GenerateClientSecretResponse", + } + 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 generate_client_secret_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[GenerateClientSecretResponse]: + """Generate new client secret + + Generate and get new client secret. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_client_secret_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GenerateClientSecretResponse", + } + 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 generate_client_secret_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Generate new client secret + + Generate and get new client secret. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_client_secret_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GenerateClientSecretResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _generate_client_secret_serialize( self, x_request_id, - **kwargs - ): - """Generate new client secret # noqa: E501 - - Generate and get new client secret. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.generate_client_secret(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - GenerateClientSecretResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.generate_client_secret_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/v1/users/client/secret', + 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_object_storage_credentials( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the S3 object storage")], + credential_id: Annotated[StrictInt, Field(description="The ID of the object storage credential")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindCredentialResponse: + """Get S3 compatible object storage credentials. + + Get S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param object_storage_id: The identifier of the S3 object storage (required) + :type object_storage_id: str + :param credential_id: The ID of the object storage credential (required) + :type credential_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + object_storage_id=object_storage_id, + credential_id=credential_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindCredentialResponse", + } + 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_object_storage_credentials_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the S3 object storage")], + credential_id: Annotated[StrictInt, Field(description="The ID of the object storage credential")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindCredentialResponse]: + """Get S3 compatible object storage credentials. + + Get S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param object_storage_id: The identifier of the S3 object storage (required) + :type object_storage_id: str + :param credential_id: The ID of the object storage credential (required) + :type credential_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + object_storage_id=object_storage_id, + credential_id=credential_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindCredentialResponse", + } + 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_object_storage_credentials_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the S3 object storage")], + credential_id: Annotated[StrictInt, Field(description="The ID of the object storage credential")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 S3 compatible object storage credentials. + + Get S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param object_storage_id: The identifier of the S3 object storage (required) + :type object_storage_id: str + :param credential_id: The ID of the object storage credential (required) + :type credential_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + object_storage_id=object_storage_id, + credential_id=credential_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindCredentialResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_object_storage_credentials_serialize( self, x_request_id, user_id, object_storage_id, credential_id, - **kwargs - ): - """Get S3 compatible object storage credentials. # noqa: E501 - - Get S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - object_storage_id (str): The identifier of the S3 object storage - credential_id (int): The ID of the object storage credential - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindCredentialResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - kwargs['object_storage_id'] = \ - object_storage_id - kwargs['credential_id'] = \ - credential_id - return self.get_object_storage_credentials_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + if object_storage_id is not None: + _path_params['objectStorageId'] = object_storage_id + if credential_id is not None: + _path_params['credentialId'] = credential_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId}', + 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_object_storage_credentials( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + object_storage_id: Annotated[Optional[StrictStr], Field(description="The identifier of the S3 object storage")] = None, + region_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central)")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by his displayName.")] = 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, + ) -> ListCredentialResponse: + """Get list of S3 compatible object storage credentials for user. + + Get list of S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param object_storage_id: The identifier of the S3 object storage + :type object_storage_id: str + :param region_name: Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central) + :type region_name: str + :param display_name: Filter for Object Storage by his displayName. + :type display_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + object_storage_id=object_storage_id, + region_name=region_name, + display_name=display_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListCredentialResponse", + } + 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_object_storage_credentials_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + object_storage_id: Annotated[Optional[StrictStr], Field(description="The identifier of the S3 object storage")] = None, + region_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central)")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by his displayName.")] = 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[ListCredentialResponse]: + """Get list of S3 compatible object storage credentials for user. + + Get list of S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param object_storage_id: The identifier of the S3 object storage + :type object_storage_id: str + :param region_name: Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central) + :type region_name: str + :param display_name: Filter for Object Storage by his displayName. + :type display_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + object_storage_id=object_storage_id, + region_name=region_name, + display_name=display_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListCredentialResponse", + } + 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_object_storage_credentials_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + object_storage_id: Annotated[Optional[StrictStr], Field(description="The identifier of the S3 object storage")] = None, + region_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central)")] = None, + display_name: Annotated[Optional[StrictStr], Field(description="Filter for Object Storage by his displayName.")] = 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 list of S3 compatible object storage credentials for user. + + Get list of S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param object_storage_id: The identifier of the S3 object storage + :type object_storage_id: str + :param region_name: Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central) + :type region_name: str + :param display_name: Filter for Object Storage by his displayName. + :type display_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + object_storage_id=object_storage_id, + region_name=region_name, + display_name=display_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListCredentialResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_object_storage_credentials_serialize( self, x_request_id, user_id, - **kwargs - ): - """Get list of S3 compatible object storage credentials for user. # noqa: E501 - - Get list of S3 compatible object storage credentials for accessing it via S3 compatible tools like `aws` cli. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_object_storage_credentials(x_request_id, user_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - object_storage_id (str): The identifier of the S3 object storage. [optional] - region_name (str): Filter for Object Storage by regions. Available regions: Asia (Singapore), European Union, United States (Central). [optional] - display_name (str): Filter for Object Storage by his displayName.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListCredentialResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - return self.list_object_storage_credentials_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + page, + size, + order_by, + object_storage_id, + region_name, + display_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if object_storage_id is not None: + + _query_params.append(('objectStorageId', object_storage_id)) + + if region_name is not None: + + _query_params.append(('regionName', region_name)) + + if display_name is not None: + + _query_params.append(('displayName', display_name)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/{userId}/object-storages/credentials', + 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 regenerate_object_storage_credentials( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the S3 object storage")], + credential_id: Annotated[StrictInt, Field(description="The ID of the object storage credential")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindCredentialResponse: + """Regenerates secret key of specified user for the S3 compatible object storages. + + Regenerates secret key of specified user for the a specific S3 compatible object storages. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param object_storage_id: The identifier of the S3 object storage (required) + :type object_storage_id: str + :param credential_id: The ID of the object storage credential (required) + :type credential_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._regenerate_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + object_storage_id=object_storage_id, + credential_id=credential_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindCredentialResponse", + } + 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 regenerate_object_storage_credentials_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the S3 object storage")], + credential_id: Annotated[StrictInt, Field(description="The ID of the object storage credential")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindCredentialResponse]: + """Regenerates secret key of specified user for the S3 compatible object storages. + + Regenerates secret key of specified user for the a specific S3 compatible object storages. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param object_storage_id: The identifier of the S3 object storage (required) + :type object_storage_id: str + :param credential_id: The ID of the object storage credential (required) + :type credential_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._regenerate_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + object_storage_id=object_storage_id, + credential_id=credential_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindCredentialResponse", + } + 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 regenerate_object_storage_credentials_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + object_storage_id: Annotated[StrictStr, Field(description="The identifier of the S3 object storage")], + credential_id: Annotated[StrictInt, Field(description="The ID of the object storage credential")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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: + """Regenerates secret key of specified user for the S3 compatible object storages. + + Regenerates secret key of specified user for the a specific S3 compatible object storages. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param object_storage_id: The identifier of the S3 object storage (required) + :type object_storage_id: str + :param credential_id: The ID of the object storage credential (required) + :type credential_id: int + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._regenerate_object_storage_credentials_serialize( + x_request_id=x_request_id, + user_id=user_id, + object_storage_id=object_storage_id, + credential_id=credential_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindCredentialResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _regenerate_object_storage_credentials_serialize( self, x_request_id, user_id, object_storage_id, credential_id, - **kwargs - ): - """Regenerates secret key of specified user for the S3 compatible object storages. # noqa: E501 - - Regenerates secret key of specified user for the a specific S3 compatible object storages. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.regenerate_object_storage_credentials(x_request_id, user_id, object_storage_id, credential_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - object_storage_id (str): The identifier of the S3 object storage - credential_id (int): The ID of the object storage credential - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindCredentialResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - kwargs['object_storage_id'] = \ - object_storage_id - kwargs['credential_id'] = \ - credential_id - return self.regenerate_object_storage_credentials_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + if object_storage_id is not None: + _path_params['objectStorageId'] = object_storage_id + if credential_id is not None: + _path_params['credentialId'] = credential_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/users/{userId}/object-storages/{objectStorageId}/credentials/{credentialId}', + 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 resend_email_verification( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + redirect_url: Annotated[Optional[StrictStr], Field(description="The redirect url used for email verification")] = 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: + """Resend email verification + + Resend email verification for a specific user + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param redirect_url: The redirect url used for email verification + :type redirect_url: 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._resend_email_verification_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + redirect_url=redirect_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 resend_email_verification_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + redirect_url: Annotated[Optional[StrictStr], Field(description="The redirect url used for email verification")] = 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]: + """Resend email verification + + Resend email verification for a specific user + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param redirect_url: The redirect url used for email verification + :type redirect_url: 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._resend_email_verification_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + redirect_url=redirect_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 resend_email_verification_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + redirect_url: Annotated[Optional[StrictStr], Field(description="The redirect url used for email verification")] = 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: + """Resend email verification + + Resend email verification for a specific user + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param redirect_url: The redirect url used for email verification + :type redirect_url: 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._resend_email_verification_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + redirect_url=redirect_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _resend_email_verification_serialize( self, x_request_id, user_id, - **kwargs - ): - """Resend email verification # noqa: E501 - - Resend email verification for a specific user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.resend_email_verification(x_request_id, user_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - redirect_url (str): The redirect url used for email verification. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - return self.resend_email_verification_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + redirect_url, + _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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if redirect_url is not None: + + _query_params.append(('redirectUrl', redirect_url)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/users/{userId}/resend-email-verification', + 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 reset_password( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + redirect_url: Annotated[Optional[StrictStr], Field(description="The redirect url used for resetting password")] = 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: + """Send reset password email + + Send reset password email for a specific user + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param redirect_url: The redirect url used for resetting password + :type redirect_url: 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._reset_password_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + redirect_url=redirect_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 reset_password_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + redirect_url: Annotated[Optional[StrictStr], Field(description="The redirect url used for resetting password")] = 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]: + """Send reset password email + + Send reset password email for a specific user + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param redirect_url: The redirect url used for resetting password + :type redirect_url: 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._reset_password_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + redirect_url=redirect_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': 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 reset_password_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + redirect_url: Annotated[Optional[StrictStr], Field(description="The redirect url used for resetting password")] = 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: + """Send reset password email + + Send reset password email for a specific user + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param redirect_url: The redirect url used for resetting password + :type redirect_url: 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._reset_password_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + redirect_url=redirect_url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _reset_password_serialize( self, x_request_id, user_id, - **kwargs - ): - """Send reset password email # noqa: E501 - - Send reset password email for a specific user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.reset_password(x_request_id, user_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - redirect_url (str): The redirect url used for resetting password. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - return self.reset_password_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + redirect_url, + _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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + if redirect_url is not None: + + _query_params.append(('redirectUrl', redirect_url)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/users/{userId}/reset-password', + 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 retrieve_user( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindUserResponse: + """Get specific user by id + + Get attributes for a specific user. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindUserResponse", + } + 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 retrieve_user_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindUserResponse]: + """Get specific user by id + + Get attributes for a specific user. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindUserResponse", + } + 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 retrieve_user_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 specific user by id + + Get attributes for a specific user. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindUserResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_user_serialize( self, x_request_id, user_id, - **kwargs - ): - """Get specific user by id # noqa: E501 - - Get attributes for a specific user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_user(x_request_id, user_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindUserResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - return self.retrieve_user_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/{userId}', + 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 retrieve_user_client( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> FindClientResponse: + """Get client + + Get idm client. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_client_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindClientResponse", + } + 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 retrieve_user_client_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[FindClientResponse]: + """Get client + + Get idm client. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_client_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindClientResponse", + } + 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 retrieve_user_client_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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 client + + Get idm client. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_user_client_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "FindClientResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_user_client_serialize( self, x_request_id, - **kwargs - ): - """Get client # noqa: E501 - - Get idm client. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_user_client(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - FindClientResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_user_client_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/client', + 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 retrieve_user_list( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + email: Annotated[Optional[StrictStr], Field(description="Filter as substring match for user emails.")] = None, + enabled: Annotated[Optional[StrictBool], Field(description="Filter if user is enabled or not.")] = None, + owner: Annotated[Optional[StrictBool], Field(description="Filter if user is owner or not.")] = 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, + ) -> ListUserResponse: + """List users + + List and filter all your users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param email: Filter as substring match for user emails. + :type email: str + :param enabled: Filter if user is enabled or not. + :type enabled: bool + :param owner: Filter if user is owner or not. + :type owner: 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._retrieve_user_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + email=email, + enabled=enabled, + owner=owner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListUserResponse", + } + 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 retrieve_user_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + email: Annotated[Optional[StrictStr], Field(description="Filter as substring match for user emails.")] = None, + enabled: Annotated[Optional[StrictBool], Field(description="Filter if user is enabled or not.")] = None, + owner: Annotated[Optional[StrictBool], Field(description="Filter if user is owner or not.")] = 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[ListUserResponse]: + """List users + + List and filter all your users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param email: Filter as substring match for user emails. + :type email: str + :param enabled: Filter if user is enabled or not. + :type enabled: bool + :param owner: Filter if user is owner or not. + :type owner: 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._retrieve_user_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + email=email, + enabled=enabled, + owner=owner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListUserResponse", + } + 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 retrieve_user_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + email: Annotated[Optional[StrictStr], Field(description="Filter as substring match for user emails.")] = None, + enabled: Annotated[Optional[StrictBool], Field(description="Filter if user is enabled or not.")] = None, + owner: Annotated[Optional[StrictBool], Field(description="Filter if user is owner or not.")] = 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 users + + List and filter all your users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param email: Filter as substring match for user emails. + :type email: str + :param enabled: Filter if user is enabled or not. + :type enabled: bool + :param owner: Filter if user is owner or not. + :type owner: 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._retrieve_user_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + email=email, + enabled=enabled, + owner=owner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListUserResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_user_list_serialize( self, x_request_id, - **kwargs - ): - """List users # noqa: E501 - - List and filter all your users. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_user_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - email (str): Filter as substring match for user emails.. [optional] - enabled (bool): Filter if user is enabled or not.. [optional] - owner (bool): Filter if user is owner or not.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListUserResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_user_list_endpoint.call_with_http_info(**kwargs) - + x_trace_id, + page, + size, + order_by, + email, + enabled, + owner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if email is not None: + + _query_params.append(('email', email)) + + if enabled is not None: + + _query_params.append(('enabled', enabled)) + + if owner is not None: + + _query_params.append(('owner', owner)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call def update_user( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + update_user_request: UpdateUserRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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, + ) -> UpdateUserResponse: + """Update specific user by id + + Update attributes of a user. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param update_user_request: (required) + :type update_user_request: UpdateUserRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + update_user_request=update_user_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateUserResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_user_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + update_user_request: UpdateUserRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = 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[UpdateUserResponse]: + """Update specific user by id + + Update attributes of a user. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param update_user_request: (required) + :type update_user_request: UpdateUserRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + update_user_request=update_user_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateUserResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_user_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + user_id: Annotated[StrictStr, Field(description="The identifier of the user.")], + update_user_request: UpdateUserRequest, + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update specific user by id + + Update attributes of a user. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param user_id: The identifier of the user. (required) + :type user_id: str + :param update_user_request: (required) + :type update_user_request: UpdateUserRequest + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_serialize( + x_request_id=x_request_id, + user_id=user_id, + update_user_request=update_user_request, + x_trace_id=x_trace_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateUserResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_user_serialize( self, x_request_id, user_id, update_user_request, - **kwargs - ): - """Update specific user by id # noqa: E501 - - Update attributes of a user. You may only specify the attributes you want to change. If an attribute is not set, it will retain its original value. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user(x_request_id, user_id, update_user_request, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - user_id (str): The identifier of the user. - update_user_request (UpdateUserRequest): - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - UpdateUserResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False - ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - kwargs['user_id'] = \ - user_id - kwargs['update_user_request'] = \ - update_user_request - return self.update_user_endpoint.call_with_http_info(**kwargs) + x_trace_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user_id is not None: + _path_params['userId'] = user_id + # process the query parameters + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + if update_user_request is not None: + _body_params = update_user_request + + + # set the HTTP header `Accept` + _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] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/v1/users/{userId}', + 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/pfruck_contabo/api/users_audits_api.py b/pfruck_contabo/api/users_audits_api.py index d785906..37f0dba 100644 --- a/pfruck_contabo/api/users_audits_api.py +++ b/pfruck_contabo/api/users_audits_api.py @@ -1,234 +1,468 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 -import re # noqa: F401 -import sys # noqa: F401 +from datetime import date +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.list_user_audit_response import ListUserAuditResponse -from pfruck_contabo.api_client import ApiClient, Endpoint as _Endpoint -from pfruck_contabo.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from pfruck_contabo.model.list_user_audit_response import ListUserAuditResponse +from pfruck_contabo.api_client import ApiClient, RequestSerialized +from pfruck_contabo.api_response import ApiResponse +from pfruck_contabo.rest import RESTResponseType -class UsersAuditsApi(object): +class UsersAuditsApi: """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): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - self.retrieve_user_audits_list_endpoint = _Endpoint( - settings={ - 'response_type': (ListUserAuditResponse,), - 'auth': [ - 'bearer' - ], - 'endpoint_path': '/v1/users/audits', - 'operation_id': 'retrieve_user_audits_list', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'x_request_id', - 'x_trace_id', - 'page', - 'size', - 'order_by', - 'user_id', - 'request_id', - 'changed_by', - 'start_date', - 'end_date', - ], - 'required': [ - 'x_request_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'x_request_id', - ] - }, - root_map={ - 'validations': { - ('x_request_id',): { - - 'regex': { - 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 - }, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_request_id': - (str,), - 'x_trace_id': - (str,), - 'page': - (int,), - 'size': - (int,), - 'order_by': - ([str],), - 'user_id': - (str,), - 'request_id': - (str,), - 'changed_by': - (str,), - 'start_date': - (date,), - 'end_date': - (date,), - }, - 'attribute_map': { - 'x_request_id': 'x-request-id', - 'x_trace_id': 'x-trace-id', - 'page': 'page', - 'size': 'size', - 'order_by': 'orderBy', - 'user_id': 'userId', - 'request_id': 'requestId', - 'changed_by': 'changedBy', - 'start_date': 'startDate', - 'end_date': 'endDate', - }, - 'location_map': { - 'x_request_id': 'header', - 'x_trace_id': 'header', - 'page': 'query', - 'size': 'query', - 'order_by': 'query', - 'user_id': 'query', - 'request_id': 'query', - 'changed_by': 'query', - 'start_date': 'query', - 'end_date': 'query', - }, - 'collection_format_map': { - 'order_by': 'multi', - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client - ) + + @validate_call def retrieve_user_audits_list( self, - x_request_id, - **kwargs - ): - """List history about your users (audit) # noqa: E501 - - List and filter the history about your users. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_user_audits_list(x_request_id, async_req=True) - >>> result = thread.get() - - Args: - x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - - Keyword Args: - x_trace_id (str): Identifier to trace group of requests.. [optional] - page (int): Number of page to be fetched.. [optional] - size (int): Number of elements per page.. [optional] - order_by ([str]): Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.. [optional] - user_id (str): The identifier of the user.. [optional] - request_id (str): The requestId of the API call which led to the change.. [optional] - changed_by (str): changedBy of the user which led to the change.. [optional] - start_date (date): Start of search time range.. [optional] - end_date (date): End of search time range.. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (int/float/tuple): 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. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _spec_property_naming (bool): True if the variable names in the input data - are serialized names, as specified in the OpenAPI document. - False if the variable names in the input data - are pythonic names, e.g. snake case (default) - _content_type (str/None): force body content-type. - Default is None and content-type will be predicted by allowed - content-types and body. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - _request_auths (list): set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - Default is None - async_req (bool): execute request asynchronously - - Returns: - ListUserAuditResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="The identifier of the user.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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, + ) -> ListUserAuditResponse: + """List history about your users (audit) + + List and filter the history about your users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param user_id: The identifier of the user. + :type user_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_user_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + user_id=user_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListUserAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_user_audits_list_with_http_info( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="The identifier of the user.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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[ListUserAuditResponse]: + """List history about your users (audit) + + List and filter the history about your users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param user_id: The identifier of the user. + :type user_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_user_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + user_id=user_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListUserAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True + + + @validate_call + def retrieve_user_audits_list_without_preload_content( + self, + x_request_id: Annotated[str, Field(strict=True, description="[Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.")], + x_trace_id: Annotated[Optional[StrictStr], Field(description="Identifier to trace group of requests.")] = None, + page: Annotated[Optional[StrictInt], Field(description="Number of page to be fetched.")] = None, + size: Annotated[Optional[StrictInt], Field(description="Number of elements per page.")] = None, + order_by: Annotated[Optional[List[StrictStr]], Field(description="Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="The identifier of the user.")] = None, + request_id: Annotated[Optional[StrictStr], Field(description="The requestId of the API call which led to the change.")] = None, + changed_by: Annotated[Optional[StrictStr], Field(description="changedBy of the user which led to the change.")] = None, + start_date: Annotated[Optional[date], Field(description="Start of search time range.")] = None, + end_date: Annotated[Optional[date], Field(description="End of search time range.")] = 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 history about your users (audit) + + List and filter the history about your users. + + :param x_request_id: [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. (required) + :type x_request_id: str + :param x_trace_id: Identifier to trace group of requests. + :type x_trace_id: str + :param page: Number of page to be fetched. + :type page: int + :param size: Number of elements per page. + :type size: int + :param order_by: Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. + :type order_by: List[str] + :param user_id: The identifier of the user. + :type user_id: str + :param request_id: The requestId of the API call which led to the change. + :type request_id: str + :param changed_by: changedBy of the user which led to the change. + :type changed_by: str + :param start_date: Start of search time range. + :type start_date: date + :param end_date: End of search time range. + :type end_date: date + :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._retrieve_user_audits_list_serialize( + x_request_id=x_request_id, + x_trace_id=x_trace_id, + page=page, + size=size, + order_by=order_by, + user_id=user_id, + request_id=request_id, + changed_by=changed_by, + start_date=start_date, + end_date=end_date, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListUserAuditResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_user_audits_list_serialize( + self, + x_request_id, + x_trace_id, + page, + size, + order_by, + user_id, + request_id, + changed_by, + start_date, + end_date, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'orderBy': '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]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if size is not None: + + _query_params.append(('size', size)) + + if order_by is not None: + + _query_params.append(('orderBy', order_by)) + + if user_id is not None: + + _query_params.append(('userId', user_id)) + + if request_id is not None: + + _query_params.append(('requestId', request_id)) + + if changed_by is not None: + + _query_params.append(('changedBy', changed_by)) + + if start_date is not None: + if isinstance(start_date, date): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, date): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + # process the header parameters + if x_request_id is not None: + _header_params['x-request-id'] = x_request_id + if x_trace_id is not None: + _header_params['x-trace-id'] = x_trace_id + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - kwargs['_spec_property_naming'] = kwargs.get( - '_spec_property_naming', False + + + # authentication setting + _auth_settings: List[str] = [ + 'bearer' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/users/audits', + 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 ) - kwargs['_content_type'] = kwargs.get( - '_content_type') - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auths'] = kwargs.get('_request_auths', None) - kwargs['x_request_id'] = \ - x_request_id - return self.retrieve_user_audits_list_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/api_client.py b/pfruck_contabo/api_client.py index 871135f..39a0b45 100644 --- a/pfruck_contabo/api_client.py +++ b/pfruck_contabo/api_client.py @@ -1,45 +1,47 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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 json -import atexit import mimetypes -from multiprocessing.pool import ThreadPool -import io import os import re -import typing -from urllib.parse import quote -from urllib3.fields import RequestField +import tempfile +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr -from pfruck_contabo import rest from pfruck_contabo.configuration import Configuration -from pfruck_contabo.exceptions import ApiTypeError, ApiValueError, ApiException -from pfruck_contabo.model_utils import ( - ModelNormal, - ModelSimple, - ModelComposed, - check_allowed_values, - check_validations, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - none_type, - validate_and_convert_types +from pfruck_contabo.api_response import ApiResponse, T as ApiResponseT +import pfruck_contabo.models +from pfruck_contabo import rest +from pfruck_contabo.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException ) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -47,28 +49,38 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :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 - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ + 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, + 'object': object, + } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + 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_copy() + configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -77,30 +89,13 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.cookie = cookie # Set default User-Agent. self.user_agent = 'OpenAPI-Generator/1.12.0/python' + self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -114,27 +109,69 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api( + + _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, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): + 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 @@ -145,14 +182,17 @@ def __call_api( 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)) + 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) + 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( @@ -160,32 +200,32 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) + 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) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body, - request_auths=_request_auths) - # request url if _host is None: url = self.configuration.host + resource_path @@ -193,312 +233,220 @@ def __call_api( # 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.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + 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: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data + 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 + """ - return_data = response_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg - if not _preload_content: - return (return_data) - return return_data + 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 - if response_type: - if response_type != (file_type,): - encoding = "utf-8" + 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) - if match: - encoding = match.group(1) - response_data.data = response_data.data.decode(encoding) - - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = 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) + if response_type in ["bytearray", "str"]: + return_data = self.__deserialize_primitive(response_text, response_type) + else: + return_data = self.deserialize(response_text, response_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) - def parameters_to_multipart(self, params, collection_types): - """Get parameters as list of tuples, formatting as json if value is collection_types + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. - :param params: Parameters as list of two-tuples - :param dict collection_types: Parameter collection types - :return: Parameters as list of tuple or urllib3.fields.RequestField - """ - new_params = [] - if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance( - v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) - else: - new_params.append((k, v)) - return new_params - - @classmethod - def sanitize_for_serialization(cls, obj): - """Prepares data for transmission before it is sent with the rest client 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 list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. - If obj is io.IOBase, return the bytes + :param obj: The data to serialize. :return: The serialized form of data. """ - if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, - val in model_to_dict( - obj, - serialize=True).items()} - elif isinstance(obj, io.IOBase): - return cls.get_file_data_and_close_file(obj) - elif isinstance(obj, (str, int, float, none_type, bool)): + 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, (datetime, date)): + 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, ModelSimple): - return cls.sanitize_for_serialization(obj.value) - elif isinstance(obj, (list, tuple)): - return [cls.sanitize_for_serialization(item) for item in obj] - if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError( - 'Unable to prepare type {} for serialization'.format( - obj.__class__.__name__)) - - def deserialize(self, response, response_type, _check_type): + + 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, response_type): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - :type _check_type: bool + :param response_type: class literal for + deserialized object, or string of class name. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) # fetch data from response object try: - received_data = json.loads(response.data) + data = json.loads(response_text) except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data + data = response_text - def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None, - _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. + return self.__deserialize(data, response_type) - :param resource_path: Path to method endpoint. - :param method: Method to call. - :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 response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :type files: dict - :param async_req bool: execute request asynchronously - :type async_req: bool, optional - :param _return_http_data_only: response data without head status code - and headers - :type _return_http_data_only: bool, optional - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :type collection_formats: dict, optional - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :type _preload_content: bool, optional - :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. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :type _check_type: bool, optional - :param _request_auths: 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_auths: list, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + 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 not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type, _request_auths=_request_auths) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type, None, _request_auths)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + 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(pfruck_contabo.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 issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -507,10 +455,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + 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: # noqa: E501 + 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': @@ -530,118 +478,169 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - @staticmethod - def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: - file_data = file_instance.read() - file_instance.close() - return file_data - - def files_parameters(self, - files: typing.Optional[typing.Dict[str, - typing.List[io.IOBase]]] = None): - """Builds form parameters. + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data + :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) """ - if files is None: - return [] + 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) - params = [] - for param_name, file_instances in files.items(): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name + 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)) ) - filename = os.path.basename(file_instance.name) - filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + 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]]): + """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 + 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): + 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 + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types, method=None, body=None): + 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. - :param method: http method (e.g. POST, PATCH). - :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: return None - content_types = [x.lower() for x in content_types] + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type - if (method == 'PATCH' and - 'application/json-patch+json' in content_types and - isinstance(body, list)): - return 'application/json-patch+json' + return content_types[0] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auths=None): + 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. - :param resource_path: A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method. - :param body: A object representing the body of the HTTP request. - The object type is the return value of _encoder.default(). - :param request_auths: if set, the provided settings will - override the token in the configuration. + :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_auths: - for auth_setting in request_auths: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting) - 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 + ) - 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 - def _apply_auth_params(self, headers, queries, resource_path, method, body, 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['key'] + "=" + auth_setting['value'] + headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] @@ -652,245 +651,120 @@ def _apply_auth_params(self, headers, queries, resource_path, method, body, auth 'Authentication token must be in `query` or `header`' ) + def __deserialize_file(self, response): + """Deserializes body to file -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type', - '_content_type', - '_spec_property_naming', - '_request_auths' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,), - '_spec_property_naming': (bool,), - '_content_type': (none_type, str), - '_request_auths': (none_type, list) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration - ) + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. - if kwargs['_check_input_type'] is False: - return + handle file downloading + save response body into a tmp file and return the instance - for key, value in kwargs.items(): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - kwargs['_spec_property_naming'], - kwargs['_check_input_type'], - configuration=self.api_client.configuration + :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 ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) - for param_name, param_value in kwargs.items(): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][base_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][base_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format + with open(path, "wb") as f: + f.write(response.data) - return params + return path - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. - api_instance = ImagesApi() - api_instance.create_custom_image # this is an instance of the class Endpoint - api_instance.create_custom_image() # this invokes api_instance.create_custom_image.__call__() - which then invokes the callable functions stored in that endpoint at - api_instance.create_custom_image.callable or self.callable in this class + :param data: str. + :param klass: class literal. + :return: int, long, float, str, bool. """ - return self.callable(self, *args, **kwargs) + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data - def call_with_http_info(self, **kwargs): + 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: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables - ) - _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + 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) ) - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in kwargs.items(): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) + 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. - self.__validate_inputs(kwargs) + :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) + ) + ) - params = self.__gather_params(kwargs) + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ - if kwargs.get('_content_type'): - params['header']['Content-Type'] = kwargs['_content_type'] - else: - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - content_types_list = self.api_client.select_header_content_type( - content_type_headers_list, self.settings['http_method'], - params['body']) - if content_types_list: - params['header']['Content-Type'] = content_types_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - _request_auths=kwargs['_request_auths'], - collection_formats=params['collection_format']) + return klass.from_dict(data) diff --git a/pfruck_contabo/api_response.py b/pfruck_contabo/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/pfruck_contabo/api_response.py @@ -0,0 +1,21 @@ +"""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/pfruck_contabo/configuration.py b/pfruck_contabo/configuration.py index e469aa2..ea04835 100644 --- a/pfruck_contabo/configuration.py +++ b/pfruck_contabo/configuration.py @@ -1,22 +1,26 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import copy import logging +from logging import FileHandler import multiprocessing import sys +from typing import Optional import urllib3 -from http import client as http_client -from pfruck_contabo.exceptions import ApiValueError - +import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -24,46 +28,20 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. +class Configuration: + """This class contains various settings of the API client. - :param host: Base url + :param host: Base url. :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) + :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 discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. + :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 @@ -72,9 +50,10 @@ class Configuration(object): 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. + 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 + in PEM format. :Example: """ @@ -83,14 +62,12 @@ class Configuration(object): def __init__(self, host=None, api_key=None, api_key_prefix=None, - access_token=None, username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", + access_token=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, - ): + ) -> None: """Constructor """ self._base_path = "https://api.contabo.com" if host is None else host @@ -108,7 +85,6 @@ def __init__(self, host=None, """Temp file folder for downloading files """ # Authentication Settings - self.access_token = access_token self.api_key = {} if api_key: self.api_key = api_key @@ -128,8 +104,9 @@ def __init__(self, host=None, self.password = password """Password for HTTP basic authentication """ - self.discard_unknown_keys = discard_unknown_keys - self.disabled_client_side_validations = disabled_client_side_validations + self.access_token = access_token + """Access token + """ self.logger = {} """Logging Settings """ @@ -141,7 +118,7 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None @@ -168,6 +145,10 @@ def __init__(self, host=None, 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 @@ -177,12 +158,9 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ - self.no_proxy = None - """bypass proxy for host in the no_proxy list. - """ self.proxy_headers = None """Proxy headers """ @@ -195,8 +173,17 @@ def __init__(self, host=None, # Enable client side validation self.client_side_validation = True - # Options to pass down to the underlying urllib3 socket 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): cls = self.__class__ @@ -214,13 +201,6 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) - for v in s: - if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) - self._disabled_client_side_validations = s @classmethod def set_default(cls, default): @@ -231,21 +211,31 @@ def set_default(cls, default): :param default: object of Configuration """ - cls._default = copy.deepcopy(default) + cls._default = default @classmethod def get_default_copy(cls): - """Return new instance of configuration. + """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): + """Return the default configuration. This method returns newly created, based on default constructor, object of Configuration class or returns a copy of default - configuration passed by the set_default method. + configuration. :return: The configuration object. """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() + if cls._default is None: + cls._default = Configuration() + return cls._default @property def logger_file(self): @@ -299,15 +289,15 @@ def debug(self, value): # if debug status is True, turn on debug logging for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 + # 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 http_client debug - http_client.HTTPConnection.debuglevel = 0 + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 @property def logger_format(self): diff --git a/pfruck_contabo/exceptions.py b/pfruck_contabo/exceptions.py index 6b4a4dc..7f78513 100644 --- a/pfruck_contabo/exceptions.py +++ b/pfruck_contabo/exceptions.py @@ -1,12 +1,18 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + 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""" @@ -14,7 +20,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -42,7 +48,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -60,7 +66,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -79,7 +85,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -97,54 +103,89 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + 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: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + 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() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @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 = "Status Code: {0}\n"\ + 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.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): +class BadRequestException(ApiException): + pass + - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) +class NotFoundException(ApiException): + pass class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) + pass def render_path(path_to_item): diff --git a/pfruck_contabo/models/__init__.py b/pfruck_contabo/models/__init__.py index fa910f7..bb37215 100644 --- a/pfruck_contabo/models/__init__.py +++ b/pfruck_contabo/models/__init__.py @@ -1,261 +1,198 @@ +# coding: utf-8 + # flake8: noqa +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -# import all models into this package -# if you have many models here with many references from one model to another this may -# raise a RecursionError -# to avoid this, import only the models that you directly need like: -# from from pfruck_contabo.model.pet import Pet -# or import this package, but before doing it, use: -# import sys -# sys.setrecursionlimit(n) -from pfruck_contabo.model.add_on_quantity_request import AddOnQuantityRequest -from pfruck_contabo.model.add_on_request import AddOnRequest -from pfruck_contabo.model.add_on_response import AddOnResponse -from pfruck_contabo.model.additional_ip import AdditionalIp -from pfruck_contabo.model.api_permissions_response import ApiPermissionsResponse -from pfruck_contabo.model.application_config import ApplicationConfig -from pfruck_contabo.model.application_requirements import ApplicationRequirements -from pfruck_contabo.model.application_requirements_minimum import ApplicationRequirementsMinimum -from pfruck_contabo.model.application_requirements_optimal import ApplicationRequirementsOptimal -from pfruck_contabo.model.application_response import ApplicationResponse -from pfruck_contabo.model.application_response_requirements import ApplicationResponseRequirements -from pfruck_contabo.model.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse -from pfruck_contabo.model.assign_instance_private_network_response_links import AssignInstancePrivateNetworkResponseLinks -from pfruck_contabo.model.assigned_tag_response import AssignedTagResponse -from pfruck_contabo.model.assignment_audit_response import AssignmentAuditResponse -from pfruck_contabo.model.assignment_response import AssignmentResponse -from pfruck_contabo.model.auto_scaling_type_request import AutoScalingTypeRequest -from pfruck_contabo.model.auto_scaling_type_response import AutoScalingTypeResponse -from pfruck_contabo.model.cancel_instance_response import CancelInstanceResponse -from pfruck_contabo.model.cancel_instance_response_data import CancelInstanceResponseData -from pfruck_contabo.model.cancel_object_storage_response import CancelObjectStorageResponse -from pfruck_contabo.model.cancel_object_storage_response_data import CancelObjectStorageResponseData -from pfruck_contabo.model.client_response import ClientResponse -from pfruck_contabo.model.client_secret_response import ClientSecretResponse -from pfruck_contabo.model.create_assignment_response import CreateAssignmentResponse -from pfruck_contabo.model.create_assignment_response_links import CreateAssignmentResponseLinks -from pfruck_contabo.model.create_custom_image_fail_response import CreateCustomImageFailResponse -from pfruck_contabo.model.create_custom_image_request import CreateCustomImageRequest -from pfruck_contabo.model.create_custom_image_response import CreateCustomImageResponse -from pfruck_contabo.model.create_custom_image_response_data import CreateCustomImageResponseData -from pfruck_contabo.model.create_custom_image_response_links import CreateCustomImageResponseLinks -from pfruck_contabo.model.create_instance_addons import CreateInstanceAddons -from pfruck_contabo.model.create_instance_addons_extra_storage import CreateInstanceAddonsExtraStorage -from pfruck_contabo.model.create_instance_request import CreateInstanceRequest -from pfruck_contabo.model.create_instance_request_add_ons import CreateInstanceRequestAddOns -from pfruck_contabo.model.create_instance_response import CreateInstanceResponse -from pfruck_contabo.model.create_instance_response_data import CreateInstanceResponseData -from pfruck_contabo.model.create_object_storage_request import CreateObjectStorageRequest -from pfruck_contabo.model.create_object_storage_request_auto_scaling import CreateObjectStorageRequestAutoScaling -from pfruck_contabo.model.create_object_storage_response import CreateObjectStorageResponse -from pfruck_contabo.model.create_object_storage_response_data import CreateObjectStorageResponseData -from pfruck_contabo.model.create_object_storage_response_links import CreateObjectStorageResponseLinks -from pfruck_contabo.model.create_private_network_request import CreatePrivateNetworkRequest -from pfruck_contabo.model.create_private_network_response import CreatePrivateNetworkResponse -from pfruck_contabo.model.create_private_network_response_links import CreatePrivateNetworkResponseLinks -from pfruck_contabo.model.create_role_request import CreateRoleRequest -from pfruck_contabo.model.create_role_response import CreateRoleResponse -from pfruck_contabo.model.create_role_response_data import CreateRoleResponseData -from pfruck_contabo.model.create_role_response_links import CreateRoleResponseLinks -from pfruck_contabo.model.create_secret_request import CreateSecretRequest -from pfruck_contabo.model.create_secret_response import CreateSecretResponse -from pfruck_contabo.model.create_secret_response_links import CreateSecretResponseLinks -from pfruck_contabo.model.create_snapshot_request import CreateSnapshotRequest -from pfruck_contabo.model.create_snapshot_response import CreateSnapshotResponse -from pfruck_contabo.model.create_snapshot_response_links import CreateSnapshotResponseLinks -from pfruck_contabo.model.create_tag_request import CreateTagRequest -from pfruck_contabo.model.create_tag_response import CreateTagResponse -from pfruck_contabo.model.create_tag_response_data import CreateTagResponseData -from pfruck_contabo.model.create_tag_response_links import CreateTagResponseLinks -from pfruck_contabo.model.create_ticket_request import CreateTicketRequest -from pfruck_contabo.model.create_ticket_response import CreateTicketResponse -from pfruck_contabo.model.create_ticket_response_data import CreateTicketResponseData -from pfruck_contabo.model.create_ticket_response_links import CreateTicketResponseLinks -from pfruck_contabo.model.create_user_request import CreateUserRequest -from pfruck_contabo.model.create_user_response import CreateUserResponse -from pfruck_contabo.model.create_user_response_data import CreateUserResponseData -from pfruck_contabo.model.create_user_response_links import CreateUserResponseLinks -from pfruck_contabo.model.credential_data import CredentialData -from pfruck_contabo.model.custom_images_stats_response import CustomImagesStatsResponse -from pfruck_contabo.model.custom_images_stats_response_data import CustomImagesStatsResponseData -from pfruck_contabo.model.custom_images_stats_response_links import CustomImagesStatsResponseLinks -from pfruck_contabo.model.data_center_response import DataCenterResponse -from pfruck_contabo.model.extra_storage_request import ExtraStorageRequest -from pfruck_contabo.model.find_assignment_response import FindAssignmentResponse -from pfruck_contabo.model.find_assignment_response_links import FindAssignmentResponseLinks -from pfruck_contabo.model.find_client_response import FindClientResponse -from pfruck_contabo.model.find_client_response_links import FindClientResponseLinks -from pfruck_contabo.model.find_credential_response import FindCredentialResponse -from pfruck_contabo.model.find_credential_response_links import FindCredentialResponseLinks -from pfruck_contabo.model.find_image_response import FindImageResponse -from pfruck_contabo.model.find_instance_response import FindInstanceResponse -from pfruck_contabo.model.find_instance_response_links import FindInstanceResponseLinks -from pfruck_contabo.model.find_object_storage_response import FindObjectStorageResponse -from pfruck_contabo.model.find_private_network_response import FindPrivateNetworkResponse -from pfruck_contabo.model.find_role_response import FindRoleResponse -from pfruck_contabo.model.find_secret_response import FindSecretResponse -from pfruck_contabo.model.find_snapshot_response import FindSnapshotResponse -from pfruck_contabo.model.find_tag_response import FindTagResponse -from pfruck_contabo.model.find_user_is_password_set_response import FindUserIsPasswordSetResponse -from pfruck_contabo.model.find_user_is_password_set_response_links import FindUserIsPasswordSetResponseLinks -from pfruck_contabo.model.find_user_response import FindUserResponse -from pfruck_contabo.model.find_vnc_response import FindVncResponse -from pfruck_contabo.model.find_vnc_response_links import FindVncResponseLinks -from pfruck_contabo.model.firewalling_upgrade_request import FirewallingUpgradeRequest -from pfruck_contabo.model.generate_client_secret_response import GenerateClientSecretResponse -from pfruck_contabo.model.generate_client_secret_response_links import GenerateClientSecretResponseLinks -from pfruck_contabo.model.image_audit_response import ImageAuditResponse -from pfruck_contabo.model.image_audit_response_data import ImageAuditResponseData -from pfruck_contabo.model.image_audit_response_links import ImageAuditResponseLinks -from pfruck_contabo.model.image_response import ImageResponse -from pfruck_contabo.model.instance_assignment_self_links import InstanceAssignmentSelfLinks -from pfruck_contabo.model.instance_rescue_action_response import InstanceRescueActionResponse -from pfruck_contabo.model.instance_rescue_action_response_data import InstanceRescueActionResponseData -from pfruck_contabo.model.instance_rescue_action_response_links import InstanceRescueActionResponseLinks -from pfruck_contabo.model.instance_reset_password_action_response import InstanceResetPasswordActionResponse -from pfruck_contabo.model.instance_reset_password_action_response_data import InstanceResetPasswordActionResponseData -from pfruck_contabo.model.instance_reset_password_action_response_links import InstanceResetPasswordActionResponseLinks -from pfruck_contabo.model.instance_response import InstanceResponse -from pfruck_contabo.model.instance_restart_action_response import InstanceRestartActionResponse -from pfruck_contabo.model.instance_restart_action_response_data import InstanceRestartActionResponseData -from pfruck_contabo.model.instance_restart_action_response_links import InstanceRestartActionResponseLinks -from pfruck_contabo.model.instance_shutdown_action_response import InstanceShutdownActionResponse -from pfruck_contabo.model.instance_shutdown_action_response_data import InstanceShutdownActionResponseData -from pfruck_contabo.model.instance_shutdown_action_response_links import InstanceShutdownActionResponseLinks -from pfruck_contabo.model.instance_start_action_response import InstanceStartActionResponse -from pfruck_contabo.model.instance_start_action_response_data import InstanceStartActionResponseData -from pfruck_contabo.model.instance_start_action_response_links import InstanceStartActionResponseLinks -from pfruck_contabo.model.instance_status import InstanceStatus -from pfruck_contabo.model.instance_stop_action_response import InstanceStopActionResponse -from pfruck_contabo.model.instance_stop_action_response_data import InstanceStopActionResponseData -from pfruck_contabo.model.instance_stop_action_response_links import InstanceStopActionResponseLinks -from pfruck_contabo.model.instances import Instances -from pfruck_contabo.model.instances_actions_audit_response import InstancesActionsAuditResponse -from pfruck_contabo.model.instances_actions_rescue_request import InstancesActionsRescueRequest -from pfruck_contabo.model.instances_audit_response import InstancesAuditResponse -from pfruck_contabo.model.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest -from pfruck_contabo.model.ip_config import IpConfig -from pfruck_contabo.model.ip_v4 import IpV4 -from pfruck_contabo.model.ip_v6 import IpV6 -from pfruck_contabo.model.links import Links -from pfruck_contabo.model.list_api_permission_response import ListApiPermissionResponse -from pfruck_contabo.model.list_api_permission_response_links import ListApiPermissionResponseLinks -from pfruck_contabo.model.list_applications_response import ListApplicationsResponse -from pfruck_contabo.model.list_applications_response_links import ListApplicationsResponseLinks -from pfruck_contabo.model.list_assignment_audits_response import ListAssignmentAuditsResponse -from pfruck_contabo.model.list_assignment_audits_response_links import ListAssignmentAuditsResponseLinks -from pfruck_contabo.model.list_assignment_response import ListAssignmentResponse -from pfruck_contabo.model.list_assignment_response_links import ListAssignmentResponseLinks -from pfruck_contabo.model.list_credential_response import ListCredentialResponse -from pfruck_contabo.model.list_credential_response_links import ListCredentialResponseLinks -from pfruck_contabo.model.list_data_center_response import ListDataCenterResponse -from pfruck_contabo.model.list_data_center_response_links import ListDataCenterResponseLinks -from pfruck_contabo.model.list_image_response import ListImageResponse -from pfruck_contabo.model.list_image_response_data import ListImageResponseData -from pfruck_contabo.model.list_image_response_links import ListImageResponseLinks -from pfruck_contabo.model.list_instances_actions_audit_response import ListInstancesActionsAuditResponse -from pfruck_contabo.model.list_instances_actions_audit_response_links import ListInstancesActionsAuditResponseLinks -from pfruck_contabo.model.list_instances_audit_response import ListInstancesAuditResponse -from pfruck_contabo.model.list_instances_audit_response_links import ListInstancesAuditResponseLinks -from pfruck_contabo.model.list_instances_response import ListInstancesResponse -from pfruck_contabo.model.list_instances_response_data import ListInstancesResponseData -from pfruck_contabo.model.list_instances_response_links import ListInstancesResponseLinks -from pfruck_contabo.model.list_instances_response_pagination import ListInstancesResponsePagination -from pfruck_contabo.model.list_object_storage_audit_response import ListObjectStorageAuditResponse -from pfruck_contabo.model.list_object_storage_audit_response_links import ListObjectStorageAuditResponseLinks -from pfruck_contabo.model.list_object_storage_response import ListObjectStorageResponse -from pfruck_contabo.model.list_object_storage_response_links import ListObjectStorageResponseLinks -from pfruck_contabo.model.list_private_network_audit_response import ListPrivateNetworkAuditResponse -from pfruck_contabo.model.list_private_network_audit_response_links import ListPrivateNetworkAuditResponseLinks -from pfruck_contabo.model.list_private_network_response import ListPrivateNetworkResponse -from pfruck_contabo.model.list_private_network_response_data import ListPrivateNetworkResponseData -from pfruck_contabo.model.list_private_network_response_links import ListPrivateNetworkResponseLinks -from pfruck_contabo.model.list_role_audit_response import ListRoleAuditResponse -from pfruck_contabo.model.list_role_audit_response_links import ListRoleAuditResponseLinks -from pfruck_contabo.model.list_role_response import ListRoleResponse -from pfruck_contabo.model.list_role_response_links import ListRoleResponseLinks -from pfruck_contabo.model.list_secret_audit_response import ListSecretAuditResponse -from pfruck_contabo.model.list_secret_audit_response_links import ListSecretAuditResponseLinks -from pfruck_contabo.model.list_secret_response import ListSecretResponse -from pfruck_contabo.model.list_secret_response_links import ListSecretResponseLinks -from pfruck_contabo.model.list_snapshot_response import ListSnapshotResponse -from pfruck_contabo.model.list_snapshot_response_links import ListSnapshotResponseLinks -from pfruck_contabo.model.list_snapshots_audit_response import ListSnapshotsAuditResponse -from pfruck_contabo.model.list_snapshots_audit_response_links import ListSnapshotsAuditResponseLinks -from pfruck_contabo.model.list_tag_audits_response import ListTagAuditsResponse -from pfruck_contabo.model.list_tag_audits_response_links import ListTagAuditsResponseLinks -from pfruck_contabo.model.list_tag_response import ListTagResponse -from pfruck_contabo.model.list_tag_response_links import ListTagResponseLinks -from pfruck_contabo.model.list_user_audit_response import ListUserAuditResponse -from pfruck_contabo.model.list_user_audit_response_links import ListUserAuditResponseLinks -from pfruck_contabo.model.list_user_response import ListUserResponse -from pfruck_contabo.model.list_user_response_links import ListUserResponseLinks -from pfruck_contabo.model.minimum_requirements import MinimumRequirements -from pfruck_contabo.model.object_storage_audit_response import ObjectStorageAuditResponse -from pfruck_contabo.model.object_storage_response import ObjectStorageResponse -from pfruck_contabo.model.object_storage_response_auto_scaling import ObjectStorageResponseAutoScaling -from pfruck_contabo.model.object_storages_stats_response import ObjectStoragesStatsResponse -from pfruck_contabo.model.object_storages_stats_response_data import ObjectStoragesStatsResponseData -from pfruck_contabo.model.object_storages_stats_response_links import ObjectStoragesStatsResponseLinks -from pfruck_contabo.model.optimal_requirements import OptimalRequirements -from pfruck_contabo.model.pagination_meta import PaginationMeta -from pfruck_contabo.model.patch_instance_request import PatchInstanceRequest -from pfruck_contabo.model.patch_instance_response import PatchInstanceResponse -from pfruck_contabo.model.patch_instance_response_data import PatchInstanceResponseData -from pfruck_contabo.model.patch_instance_response_links import PatchInstanceResponseLinks -from pfruck_contabo.model.patch_object_storage_request import PatchObjectStorageRequest -from pfruck_contabo.model.patch_private_network_request import PatchPrivateNetworkRequest -from pfruck_contabo.model.patch_private_network_response import PatchPrivateNetworkResponse -from pfruck_contabo.model.patch_vnc_request import PatchVncRequest -from pfruck_contabo.model.permission_request import PermissionRequest -from pfruck_contabo.model.permission_response import PermissionResponse -from pfruck_contabo.model.private_ip_config import PrivateIpConfig -from pfruck_contabo.model.private_network_audit_response import PrivateNetworkAuditResponse -from pfruck_contabo.model.private_network_response import PrivateNetworkResponse -from pfruck_contabo.model.reinstall_instance_request import ReinstallInstanceRequest -from pfruck_contabo.model.reinstall_instance_response import ReinstallInstanceResponse -from pfruck_contabo.model.reinstall_instance_response_data import ReinstallInstanceResponseData -from pfruck_contabo.model.resource_permissions_response import ResourcePermissionsResponse -from pfruck_contabo.model.role_audit_response import RoleAuditResponse -from pfruck_contabo.model.role_response import RoleResponse -from pfruck_contabo.model.rollback_snapshot_response import RollbackSnapshotResponse -from pfruck_contabo.model.rollback_snapshot_response_links import RollbackSnapshotResponseLinks -from pfruck_contabo.model.secret_audit_response import SecretAuditResponse -from pfruck_contabo.model.secret_response import SecretResponse -from pfruck_contabo.model.self_links import SelfLinks -from pfruck_contabo.model.snapshot_response import SnapshotResponse -from pfruck_contabo.model.snapshots_audit_response import SnapshotsAuditResponse -from pfruck_contabo.model.tag_assignment_self_links import TagAssignmentSelfLinks -from pfruck_contabo.model.tag_audit_response import TagAuditResponse -from pfruck_contabo.model.tag_response import TagResponse -from pfruck_contabo.model.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse -from pfruck_contabo.model.update_custom_image_request import UpdateCustomImageRequest -from pfruck_contabo.model.update_custom_image_response import UpdateCustomImageResponse -from pfruck_contabo.model.update_custom_image_response_data import UpdateCustomImageResponseData -from pfruck_contabo.model.update_role_request import UpdateRoleRequest -from pfruck_contabo.model.update_role_response import UpdateRoleResponse -from pfruck_contabo.model.update_role_response_links import UpdateRoleResponseLinks -from pfruck_contabo.model.update_secret_request import UpdateSecretRequest -from pfruck_contabo.model.update_secret_response import UpdateSecretResponse -from pfruck_contabo.model.update_secret_response_links import UpdateSecretResponseLinks -from pfruck_contabo.model.update_snapshot_request import UpdateSnapshotRequest -from pfruck_contabo.model.update_snapshot_response import UpdateSnapshotResponse -from pfruck_contabo.model.update_tag_request import UpdateTagRequest -from pfruck_contabo.model.update_tag_response import UpdateTagResponse -from pfruck_contabo.model.update_tag_response_links import UpdateTagResponseLinks -from pfruck_contabo.model.update_user_request import UpdateUserRequest -from pfruck_contabo.model.update_user_response import UpdateUserResponse -from pfruck_contabo.model.update_user_response_links import UpdateUserResponseLinks -from pfruck_contabo.model.upgrade_auto_scaling_type import UpgradeAutoScalingType -from pfruck_contabo.model.upgrade_instance_request import UpgradeInstanceRequest -from pfruck_contabo.model.upgrade_object_storage_request import UpgradeObjectStorageRequest -from pfruck_contabo.model.upgrade_object_storage_request_auto_scaling import UpgradeObjectStorageRequestAutoScaling -from pfruck_contabo.model.upgrade_object_storage_response import UpgradeObjectStorageResponse -from pfruck_contabo.model.upgrade_object_storage_response_data import UpgradeObjectStorageResponseData -from pfruck_contabo.model.upgrade_object_storage_response_data_auto_scaling import UpgradeObjectStorageResponseDataAutoScaling -from pfruck_contabo.model.upgrade_object_storage_response_links import UpgradeObjectStorageResponseLinks -from pfruck_contabo.model.user_audit_response import UserAuditResponse -from pfruck_contabo.model.user_is_password_set_response import UserIsPasswordSetResponse -from pfruck_contabo.model.user_response import UserResponse -from pfruck_contabo.model.vnc_response import VncResponse +# import models into model package +from pfruck_contabo.models.add_on_quantity_request import AddOnQuantityRequest +from pfruck_contabo.models.add_on_request import AddOnRequest +from pfruck_contabo.models.add_on_response import AddOnResponse +from pfruck_contabo.models.additional_ip import AdditionalIp +from pfruck_contabo.models.api_permissions_response import ApiPermissionsResponse +from pfruck_contabo.models.application_config import ApplicationConfig +from pfruck_contabo.models.application_requirements import ApplicationRequirements +from pfruck_contabo.models.application_response import ApplicationResponse +from pfruck_contabo.models.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse +from pfruck_contabo.models.assigned_tag_response import AssignedTagResponse +from pfruck_contabo.models.assignment_audit_response import AssignmentAuditResponse +from pfruck_contabo.models.assignment_response import AssignmentResponse +from pfruck_contabo.models.auto_scaling_type_request import AutoScalingTypeRequest +from pfruck_contabo.models.auto_scaling_type_response import AutoScalingTypeResponse +from pfruck_contabo.models.cancel_instance_response import CancelInstanceResponse +from pfruck_contabo.models.cancel_instance_response_data import CancelInstanceResponseData +from pfruck_contabo.models.cancel_object_storage_response import CancelObjectStorageResponse +from pfruck_contabo.models.cancel_object_storage_response_data import CancelObjectStorageResponseData +from pfruck_contabo.models.client_response import ClientResponse +from pfruck_contabo.models.client_secret_response import ClientSecretResponse +from pfruck_contabo.models.create_assignment_response import CreateAssignmentResponse +from pfruck_contabo.models.create_custom_image_fail_response import CreateCustomImageFailResponse +from pfruck_contabo.models.create_custom_image_request import CreateCustomImageRequest +from pfruck_contabo.models.create_custom_image_response import CreateCustomImageResponse +from pfruck_contabo.models.create_custom_image_response_data import CreateCustomImageResponseData +from pfruck_contabo.models.create_instance_addons import CreateInstanceAddons +from pfruck_contabo.models.create_instance_request import CreateInstanceRequest +from pfruck_contabo.models.create_instance_response import CreateInstanceResponse +from pfruck_contabo.models.create_instance_response_data import CreateInstanceResponseData +from pfruck_contabo.models.create_object_storage_request import CreateObjectStorageRequest +from pfruck_contabo.models.create_object_storage_response import CreateObjectStorageResponse +from pfruck_contabo.models.create_object_storage_response_data import CreateObjectStorageResponseData +from pfruck_contabo.models.create_private_network_request import CreatePrivateNetworkRequest +from pfruck_contabo.models.create_private_network_response import CreatePrivateNetworkResponse +from pfruck_contabo.models.create_role_request import CreateRoleRequest +from pfruck_contabo.models.create_role_response import CreateRoleResponse +from pfruck_contabo.models.create_role_response_data import CreateRoleResponseData +from pfruck_contabo.models.create_secret_request import CreateSecretRequest +from pfruck_contabo.models.create_secret_response import CreateSecretResponse +from pfruck_contabo.models.create_snapshot_request import CreateSnapshotRequest +from pfruck_contabo.models.create_snapshot_response import CreateSnapshotResponse +from pfruck_contabo.models.create_tag_request import CreateTagRequest +from pfruck_contabo.models.create_tag_response import CreateTagResponse +from pfruck_contabo.models.create_tag_response_data import CreateTagResponseData +from pfruck_contabo.models.create_ticket_request import CreateTicketRequest +from pfruck_contabo.models.create_ticket_response import CreateTicketResponse +from pfruck_contabo.models.create_ticket_response_data import CreateTicketResponseData +from pfruck_contabo.models.create_user_request import CreateUserRequest +from pfruck_contabo.models.create_user_response import CreateUserResponse +from pfruck_contabo.models.create_user_response_data import CreateUserResponseData +from pfruck_contabo.models.credential_data import CredentialData +from pfruck_contabo.models.custom_images_stats_response import CustomImagesStatsResponse +from pfruck_contabo.models.custom_images_stats_response_data import CustomImagesStatsResponseData +from pfruck_contabo.models.data_center_response import DataCenterResponse +from pfruck_contabo.models.extra_storage_request import ExtraStorageRequest +from pfruck_contabo.models.find_assignment_response import FindAssignmentResponse +from pfruck_contabo.models.find_client_response import FindClientResponse +from pfruck_contabo.models.find_credential_response import FindCredentialResponse +from pfruck_contabo.models.find_image_response import FindImageResponse +from pfruck_contabo.models.find_instance_response import FindInstanceResponse +from pfruck_contabo.models.find_object_storage_response import FindObjectStorageResponse +from pfruck_contabo.models.find_private_network_response import FindPrivateNetworkResponse +from pfruck_contabo.models.find_role_response import FindRoleResponse +from pfruck_contabo.models.find_secret_response import FindSecretResponse +from pfruck_contabo.models.find_snapshot_response import FindSnapshotResponse +from pfruck_contabo.models.find_tag_response import FindTagResponse +from pfruck_contabo.models.find_user_is_password_set_response import FindUserIsPasswordSetResponse +from pfruck_contabo.models.find_user_response import FindUserResponse +from pfruck_contabo.models.find_vnc_response import FindVncResponse +from pfruck_contabo.models.firewalling_upgrade_request import FirewallingUpgradeRequest +from pfruck_contabo.models.generate_client_secret_response import GenerateClientSecretResponse +from pfruck_contabo.models.image_audit_response import ImageAuditResponse +from pfruck_contabo.models.image_audit_response_data import ImageAuditResponseData +from pfruck_contabo.models.image_response import ImageResponse +from pfruck_contabo.models.instance_assignment_self_links import InstanceAssignmentSelfLinks +from pfruck_contabo.models.instance_rescue_action_response import InstanceRescueActionResponse +from pfruck_contabo.models.instance_rescue_action_response_data import InstanceRescueActionResponseData +from pfruck_contabo.models.instance_reset_password_action_response import InstanceResetPasswordActionResponse +from pfruck_contabo.models.instance_reset_password_action_response_data import InstanceResetPasswordActionResponseData +from pfruck_contabo.models.instance_response import InstanceResponse +from pfruck_contabo.models.instance_restart_action_response import InstanceRestartActionResponse +from pfruck_contabo.models.instance_restart_action_response_data import InstanceRestartActionResponseData +from pfruck_contabo.models.instance_shutdown_action_response import InstanceShutdownActionResponse +from pfruck_contabo.models.instance_shutdown_action_response_data import InstanceShutdownActionResponseData +from pfruck_contabo.models.instance_start_action_response import InstanceStartActionResponse +from pfruck_contabo.models.instance_start_action_response_data import InstanceStartActionResponseData +from pfruck_contabo.models.instance_status import InstanceStatus +from pfruck_contabo.models.instance_stop_action_response import InstanceStopActionResponse +from pfruck_contabo.models.instance_stop_action_response_data import InstanceStopActionResponseData +from pfruck_contabo.models.instances import Instances +from pfruck_contabo.models.instances_actions_audit_response import InstancesActionsAuditResponse +from pfruck_contabo.models.instances_actions_rescue_request import InstancesActionsRescueRequest +from pfruck_contabo.models.instances_audit_response import InstancesAuditResponse +from pfruck_contabo.models.instances_reset_password_actions_request import InstancesResetPasswordActionsRequest +from pfruck_contabo.models.ip_config import IpConfig +from pfruck_contabo.models.ip_v4 import IpV4 +from pfruck_contabo.models.ip_v6 import IpV6 +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.list_api_permission_response import ListApiPermissionResponse +from pfruck_contabo.models.list_applications_response import ListApplicationsResponse +from pfruck_contabo.models.list_assignment_audits_response import ListAssignmentAuditsResponse +from pfruck_contabo.models.list_assignment_response import ListAssignmentResponse +from pfruck_contabo.models.list_credential_response import ListCredentialResponse +from pfruck_contabo.models.list_data_center_response import ListDataCenterResponse +from pfruck_contabo.models.list_image_response import ListImageResponse +from pfruck_contabo.models.list_image_response_data import ListImageResponseData +from pfruck_contabo.models.list_instances_actions_audit_response import ListInstancesActionsAuditResponse +from pfruck_contabo.models.list_instances_audit_response import ListInstancesAuditResponse +from pfruck_contabo.models.list_instances_response import ListInstancesResponse +from pfruck_contabo.models.list_instances_response_data import ListInstancesResponseData +from pfruck_contabo.models.list_object_storage_audit_response import ListObjectStorageAuditResponse +from pfruck_contabo.models.list_object_storage_response import ListObjectStorageResponse +from pfruck_contabo.models.list_private_network_audit_response import ListPrivateNetworkAuditResponse +from pfruck_contabo.models.list_private_network_response import ListPrivateNetworkResponse +from pfruck_contabo.models.list_private_network_response_data import ListPrivateNetworkResponseData +from pfruck_contabo.models.list_role_audit_response import ListRoleAuditResponse +from pfruck_contabo.models.list_role_response import ListRoleResponse +from pfruck_contabo.models.list_secret_audit_response import ListSecretAuditResponse +from pfruck_contabo.models.list_secret_response import ListSecretResponse +from pfruck_contabo.models.list_snapshot_response import ListSnapshotResponse +from pfruck_contabo.models.list_snapshots_audit_response import ListSnapshotsAuditResponse +from pfruck_contabo.models.list_tag_audits_response import ListTagAuditsResponse +from pfruck_contabo.models.list_tag_response import ListTagResponse +from pfruck_contabo.models.list_user_audit_response import ListUserAuditResponse +from pfruck_contabo.models.list_user_response import ListUserResponse +from pfruck_contabo.models.minimum_requirements import MinimumRequirements +from pfruck_contabo.models.object_storage_audit_response import ObjectStorageAuditResponse +from pfruck_contabo.models.object_storage_response import ObjectStorageResponse +from pfruck_contabo.models.object_storages_stats_response import ObjectStoragesStatsResponse +from pfruck_contabo.models.object_storages_stats_response_data import ObjectStoragesStatsResponseData +from pfruck_contabo.models.optimal_requirements import OptimalRequirements +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.patch_instance_request import PatchInstanceRequest +from pfruck_contabo.models.patch_instance_response import PatchInstanceResponse +from pfruck_contabo.models.patch_instance_response_data import PatchInstanceResponseData +from pfruck_contabo.models.patch_object_storage_request import PatchObjectStorageRequest +from pfruck_contabo.models.patch_private_network_request import PatchPrivateNetworkRequest +from pfruck_contabo.models.patch_private_network_response import PatchPrivateNetworkResponse +from pfruck_contabo.models.patch_vnc_request import PatchVncRequest +from pfruck_contabo.models.permission_request import PermissionRequest +from pfruck_contabo.models.permission_response import PermissionResponse +from pfruck_contabo.models.private_ip_config import PrivateIpConfig +from pfruck_contabo.models.private_network_audit_response import PrivateNetworkAuditResponse +from pfruck_contabo.models.private_network_response import PrivateNetworkResponse +from pfruck_contabo.models.reinstall_instance_request import ReinstallInstanceRequest +from pfruck_contabo.models.reinstall_instance_response import ReinstallInstanceResponse +from pfruck_contabo.models.reinstall_instance_response_data import ReinstallInstanceResponseData +from pfruck_contabo.models.resource_permissions_response import ResourcePermissionsResponse +from pfruck_contabo.models.role_audit_response import RoleAuditResponse +from pfruck_contabo.models.role_response import RoleResponse +from pfruck_contabo.models.rollback_snapshot_response import RollbackSnapshotResponse +from pfruck_contabo.models.secret_audit_response import SecretAuditResponse +from pfruck_contabo.models.secret_response import SecretResponse +from pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.snapshot_response import SnapshotResponse +from pfruck_contabo.models.snapshots_audit_response import SnapshotsAuditResponse +from pfruck_contabo.models.tag_assignment_self_links import TagAssignmentSelfLinks +from pfruck_contabo.models.tag_audit_response import TagAuditResponse +from pfruck_contabo.models.tag_response import TagResponse +from pfruck_contabo.models.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse +from pfruck_contabo.models.update_custom_image_request import UpdateCustomImageRequest +from pfruck_contabo.models.update_custom_image_response import UpdateCustomImageResponse +from pfruck_contabo.models.update_custom_image_response_data import UpdateCustomImageResponseData +from pfruck_contabo.models.update_role_request import UpdateRoleRequest +from pfruck_contabo.models.update_role_response import UpdateRoleResponse +from pfruck_contabo.models.update_secret_request import UpdateSecretRequest +from pfruck_contabo.models.update_secret_response import UpdateSecretResponse +from pfruck_contabo.models.update_snapshot_request import UpdateSnapshotRequest +from pfruck_contabo.models.update_snapshot_response import UpdateSnapshotResponse +from pfruck_contabo.models.update_tag_request import UpdateTagRequest +from pfruck_contabo.models.update_tag_response import UpdateTagResponse +from pfruck_contabo.models.update_user_request import UpdateUserRequest +from pfruck_contabo.models.update_user_response import UpdateUserResponse +from pfruck_contabo.models.upgrade_auto_scaling_type import UpgradeAutoScalingType +from pfruck_contabo.models.upgrade_instance_request import UpgradeInstanceRequest +from pfruck_contabo.models.upgrade_object_storage_request import UpgradeObjectStorageRequest +from pfruck_contabo.models.upgrade_object_storage_response import UpgradeObjectStorageResponse +from pfruck_contabo.models.upgrade_object_storage_response_data import UpgradeObjectStorageResponseData +from pfruck_contabo.models.user_audit_response import UserAuditResponse +from pfruck_contabo.models.user_is_password_set_response import UserIsPasswordSetResponse +from pfruck_contabo.models.user_response import UserResponse +from pfruck_contabo.models.vnc_response import VncResponse diff --git a/pfruck_contabo/models/add_on_quantity_request.py b/pfruck_contabo/models/add_on_quantity_request.py new file mode 100644 index 0000000..9bc163d --- /dev/null +++ b/pfruck_contabo/models/add_on_quantity_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Optional, Set +from typing_extensions import Self + +class AddOnQuantityRequest(BaseModel): + """ + AddOnQuantityRequest + """ # noqa: E501 + quantity: StrictInt = Field(description="The number of Addons you wish to aquire.") + __properties: ClassVar[List[str]] = ["quantity"] + + 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 AddOnQuantityRequest 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 AddOnQuantityRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "quantity": obj.get("quantity") + }) + return _obj + + diff --git a/pfruck_contabo/models/add_on_request.py b/pfruck_contabo/models/add_on_request.py new file mode 100644 index 0000000..d1fbb1a --- /dev/null +++ b/pfruck_contabo/models/add_on_request.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Optional, Set +from typing_extensions import Self + +class AddOnRequest(BaseModel): + """ + AddOnRequest + """ # noqa: E501 + id: StrictInt = Field(description="Id of the Addon. Please refer to list [here](https://contabo.com/en/product-list/?show_ids=true).") + quantity: StrictInt = Field(description="The number of Addons you wish to aquire.") + __properties: ClassVar[List[str]] = ["id", "quantity"] + + 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 AddOnRequest 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 AddOnRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "quantity": obj.get("quantity") + }) + return _obj + + diff --git a/pfruck_contabo/models/add_on_response.py b/pfruck_contabo/models/add_on_response.py new file mode 100644 index 0000000..ab67677 --- /dev/null +++ b/pfruck_contabo/models/add_on_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Optional, Set +from typing_extensions import Self + +class AddOnResponse(BaseModel): + """ + AddOnResponse + """ # noqa: E501 + id: StrictInt = Field(description="Id of the Addon. Please refer to list [here](https://contabo.com/en/product-list/?show_ids=true).") + quantity: StrictInt = Field(description="The number of Addons you wish to aquire.") + __properties: ClassVar[List[str]] = ["id", "quantity"] + + 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 AddOnResponse 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 AddOnResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "quantity": obj.get("quantity") + }) + return _obj + + diff --git a/pfruck_contabo/models/additional_ip.py b/pfruck_contabo/models/additional_ip.py new file mode 100644 index 0000000..c6267b2 --- /dev/null +++ b/pfruck_contabo/models/additional_ip.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.ip_v4 import IpV4 +from typing import Optional, Set +from typing_extensions import Self + +class AdditionalIp(BaseModel): + """ + AdditionalIp + """ # noqa: E501 + v4: IpV4 + __properties: ClassVar[List[str]] = ["v4"] + + 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 AdditionalIp 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 v4 + if self.v4: + _dict['v4'] = self.v4.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AdditionalIp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "v4": IpV4.from_dict(obj["v4"]) if obj.get("v4") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/api_permissions_response.py b/pfruck_contabo/models/api_permissions_response.py new file mode 100644 index 0000000..7e43084 --- /dev/null +++ b/pfruck_contabo/models/api_permissions_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 import Optional, Set +from typing_extensions import Self + +class ApiPermissionsResponse(BaseModel): + """ + ApiPermissionsResponse + """ # noqa: E501 + api_name: StrictStr = Field(description="API endpoint. In order to get a list availbale api enpoints please refer to the GET api-permissions endpoint.", alias="apiName") + actions: List[StrictStr] = Field(description="Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints.") + __properties: ClassVar[List[str]] = ["apiName", "actions"] + + @field_validator('actions') + def actions_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['CREATE', 'READ', 'UPDATE', 'DELETE']): + raise ValueError("each list item must be one of ('CREATE', 'READ', 'UPDATE', 'DELETE')") + 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 ApiPermissionsResponse 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 ApiPermissionsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "apiName": obj.get("apiName"), + "actions": obj.get("actions") + }) + return _obj + + diff --git a/pfruck_contabo/models/application_config.py b/pfruck_contabo/models/application_config.py new file mode 100644 index 0000000..f266f69 --- /dev/null +++ b/pfruck_contabo/models/application_config.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 ApplicationConfig(BaseModel): + """ + ApplicationConfig + """ # noqa: E501 + image_id: StrictStr = Field(description="Image ID", alias="imageId") + user_data_id: StrictStr = Field(description="User Data ID", alias="userDataId") + user_data: StrictStr = Field(description="[Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance.", alias="userData") + __properties: ClassVar[List[str]] = ["imageId", "userDataId", "userData"] + + 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 ApplicationConfig 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 ApplicationConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageId": obj.get("imageId"), + "userDataId": obj.get("userDataId"), + "userData": obj.get("userData") + }) + return _obj + + diff --git a/pfruck_contabo/models/application_requirements.py b/pfruck_contabo/models/application_requirements.py new file mode 100644 index 0000000..a2ae848 --- /dev/null +++ b/pfruck_contabo/models/application_requirements.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.minimum_requirements import MinimumRequirements +from pfruck_contabo.models.optimal_requirements import OptimalRequirements +from typing import Optional, Set +from typing_extensions import Self + +class ApplicationRequirements(BaseModel): + """ + ApplicationRequirements + """ # noqa: E501 + minimum: Optional[MinimumRequirements] = Field(default=None, description="Application minimum requirements") + optimal: Optional[OptimalRequirements] = Field(default=None, description="Application optimal requirements") + __properties: ClassVar[List[str]] = ["minimum", "optimal"] + + 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 ApplicationRequirements 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 minimum + if self.minimum: + _dict['minimum'] = self.minimum.to_dict() + # override the default output from pydantic by calling `to_dict()` of optimal + if self.optimal: + _dict['optimal'] = self.optimal.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApplicationRequirements from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "minimum": MinimumRequirements.from_dict(obj["minimum"]) if obj.get("minimum") is not None else None, + "optimal": OptimalRequirements.from_dict(obj["optimal"]) if obj.get("optimal") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/application_response.py b/pfruck_contabo/models/application_response.py new file mode 100644 index 0000000..43403c7 --- /dev/null +++ b/pfruck_contabo/models/application_response.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.application_config import ApplicationConfig +from pfruck_contabo.models.application_requirements import ApplicationRequirements +from typing import Optional, Set +from typing_extensions import Self + +class ApplicationResponse(BaseModel): + """ + ApplicationResponse + """ # noqa: E501 + application_id: StrictStr = Field(description="Application ID", alias="applicationId") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Tenant ID", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + name: StrictStr = Field(description="Application Name") + description: StrictStr = Field(description="Application Description") + type: StrictStr = Field(description="Application type") + application_config: List[ApplicationConfig] = Field(description="Application Config", alias="applicationConfig") + requirements: ApplicationRequirements = Field(description="Application Requirements") + __properties: ClassVar[List[str]] = ["applicationId", "tenantId", "customerId", "name", "description", "type", "applicationConfig", "requirements"] + + @field_validator('tenant_id') + def tenant_id_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DE', 'INT']): + raise ValueError("must be one of enum values ('DE', 'INT')") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['standard', 'crypto']): + raise ValueError("must be one of enum values ('standard', 'crypto')") + 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 ApplicationResponse 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 application_config (list) + _items = [] + if self.application_config: + for _item in self.application_config: + if _item: + _items.append(_item.to_dict()) + _dict['applicationConfig'] = _items + # override the default output from pydantic by calling `to_dict()` of requirements + if self.requirements: + _dict['requirements'] = self.requirements.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApplicationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applicationId": obj.get("applicationId"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "name": obj.get("name"), + "description": obj.get("description"), + "type": obj.get("type"), + "applicationConfig": [ApplicationConfig.from_dict(_item) for _item in obj["applicationConfig"]] if obj.get("applicationConfig") is not None else None, + "requirements": ApplicationRequirements.from_dict(obj["requirements"]) if obj.get("requirements") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/assign_instance_private_network_response.py b/pfruck_contabo/models/assign_instance_private_network_response.py new file mode 100644 index 0000000..ae32e75 --- /dev/null +++ b/pfruck_contabo/models/assign_instance_private_network_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_assignment_self_links import InstanceAssignmentSelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class AssignInstancePrivateNetworkResponse(BaseModel): + """ + AssignInstancePrivateNetworkResponse + """ # noqa: E501 + links: InstanceAssignmentSelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 AssignInstancePrivateNetworkResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignInstancePrivateNetworkResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": InstanceAssignmentSelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/assigned_tag_response.py b/pfruck_contabo/models/assigned_tag_response.py new file mode 100644 index 0000000..71e68f0 --- /dev/null +++ b/pfruck_contabo/models/assigned_tag_response.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AssignedTagResponse(BaseModel): + """ + AssignedTagResponse + """ # noqa: E501 + tag_id: Union[StrictFloat, StrictInt] = Field(description="Tag's id", alias="tagId") + tag_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Tag's name", alias="tagName") + __properties: ClassVar[List[str]] = ["tagId", "tagName"] + + 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 AssignedTagResponse 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 AssignedTagResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tagId": obj.get("tagId"), + "tagName": obj.get("tagName") + }) + return _obj + + diff --git a/pfruck_contabo/models/assignment_audit_response.py b/pfruck_contabo/models/assignment_audit_response.py new file mode 100644 index 0000000..417872d --- /dev/null +++ b/pfruck_contabo/models/assignment_audit_response.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AssignmentAuditResponse(BaseModel): + """ + AssignmentAuditResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + id: Union[StrictFloat, StrictInt] = Field(description="The identifier of the audit entry.") + resource_id: StrictStr = Field(description="Resource's id", alias="resourceId") + resource_type: StrictStr = Field(description="Resource type. Resource type is one of `instance|image|object-storage`.", alias="resourceType") + tag_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="Tag's id", alias="tagId") + action: StrictStr = Field(description="Audit Action") + timestamp: datetime = Field(description="Audit creation date") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User ID", alias="changedBy") + username: StrictStr = Field(description="User Full Name") + request_id: StrictStr = Field(description="Request ID", alias="requestId") + trace_id: StrictStr = Field(description="Trace ID", alias="traceId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="Changes made for a specific Tag") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "id", "resourceId", "resourceType", "tagId", "action", "timestamp", "changedBy", "username", "requestId", "traceId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'DELETED')") + 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 AssignmentAuditResponse 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 AssignmentAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "id": obj.get("id"), + "resourceId": obj.get("resourceId"), + "resourceType": obj.get("resourceType"), + "tagId": obj.get("tagId"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/assignment_response.py b/pfruck_contabo/models/assignment_response.py new file mode 100644 index 0000000..a047a9a --- /dev/null +++ b/pfruck_contabo/models/assignment_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class AssignmentResponse(BaseModel): + """ + AssignmentResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + tag_id: StrictInt = Field(description="The identifier of the tag.", alias="tagId") + tag_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Tag's name", alias="tagName") + resource_type: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Resource type. Resource type is one of `instance|image|object-storage`.", alias="resourceType") + resource_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Resource id", alias="resourceId") + resource_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Resource name", alias="resourceName") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "tagId", "tagName", "resourceType", "resourceId", "resourceName"] + + 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 AssignmentResponse 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 AssignmentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "tagId": obj.get("tagId"), + "tagName": obj.get("tagName"), + "resourceType": obj.get("resourceType"), + "resourceId": obj.get("resourceId"), + "resourceName": obj.get("resourceName") + }) + return _obj + + diff --git a/pfruck_contabo/models/auto_scaling_type_request.py b/pfruck_contabo/models/auto_scaling_type_request.py new file mode 100644 index 0000000..4a37aa4 --- /dev/null +++ b/pfruck_contabo/models/auto_scaling_type_request.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 import Optional, Set +from typing_extensions import Self + +class AutoScalingTypeRequest(BaseModel): + """ + AutoScalingTypeRequest + """ # noqa: E501 + state: StrictStr = Field(description="State of the autoscaling for the current object storage.") + size_limit_tb: Union[StrictFloat, StrictInt] = Field(description="Autoscaling size limit for the current object storage.", alias="sizeLimitTB") + __properties: ClassVar[List[str]] = ["state", "sizeLimitTB"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['enabled', 'disabled']): + raise ValueError("must be one of enum values ('enabled', 'disabled')") + 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 AutoScalingTypeRequest 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 AutoScalingTypeRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "state": obj.get("state"), + "sizeLimitTB": obj.get("sizeLimitTB") + }) + return _obj + + diff --git a/pfruck_contabo/models/auto_scaling_type_response.py b/pfruck_contabo/models/auto_scaling_type_response.py new file mode 100644 index 0000000..13c933e --- /dev/null +++ b/pfruck_contabo/models/auto_scaling_type_response.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class AutoScalingTypeResponse(BaseModel): + """ + AutoScalingTypeResponse + """ # noqa: E501 + state: StrictStr = Field(description="State of the autoscaling for the current object storage.") + size_limit_tb: Union[StrictFloat, StrictInt] = Field(description="Autoscaling size limit for the current object storage.", alias="sizeLimitTB") + error_message: Optional[StrictStr] = Field(default=None, description="Error message", alias="errorMessage") + __properties: ClassVar[List[str]] = ["state", "sizeLimitTB", "errorMessage"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['enabled', 'disabled', 'error']): + raise ValueError("must be one of enum values ('enabled', 'disabled', 'error')") + 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 AutoScalingTypeResponse 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 AutoScalingTypeResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "state": obj.get("state"), + "sizeLimitTB": obj.get("sizeLimitTB"), + "errorMessage": obj.get("errorMessage") + }) + return _obj + + diff --git a/pfruck_contabo/models/cancel_instance_response.py b/pfruck_contabo/models/cancel_instance_response.py new file mode 100644 index 0000000..b25ce59 --- /dev/null +++ b/pfruck_contabo/models/cancel_instance_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.cancel_instance_response_data import CancelInstanceResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CancelInstanceResponse(BaseModel): + """ + CancelInstanceResponse + """ # noqa: E501 + data: List[CancelInstanceResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CancelInstanceResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CancelInstanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CancelInstanceResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/cancel_instance_response_data.py b/pfruck_contabo/models/cancel_instance_response_data.py new file mode 100644 index 0000000..4941f22 --- /dev/null +++ b/pfruck_contabo/models/cancel_instance_response_data.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 date +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CancelInstanceResponseData(BaseModel): + """ + CancelInstanceResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Instance's id", alias="instanceId") + cancel_date: date = Field(description="The date on which the instance will be cancelled", alias="cancelDate") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "cancelDate"] + + 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 CancelInstanceResponseData 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 CancelInstanceResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "cancelDate": obj.get("cancelDate") + }) + return _obj + + diff --git a/pfruck_contabo/models/cancel_object_storage_response.py b/pfruck_contabo/models/cancel_object_storage_response.py new file mode 100644 index 0000000..6cb71ab --- /dev/null +++ b/pfruck_contabo/models/cancel_object_storage_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.cancel_object_storage_response_data import CancelObjectStorageResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CancelObjectStorageResponse(BaseModel): + """ + CancelObjectStorageResponse + """ # noqa: E501 + links: SelfLinks = Field(alias="_links") + data: List[CancelObjectStorageResponseData] + __properties: ClassVar[List[str]] = ["_links", "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 CancelObjectStorageResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CancelObjectStorageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "data": [CancelObjectStorageResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/cancel_object_storage_response_data.py b/pfruck_contabo/models/cancel_object_storage_response_data.py new file mode 100644 index 0000000..c8ebb0b --- /dev/null +++ b/pfruck_contabo/models/cancel_object_storage_response_data.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 date +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CancelObjectStorageResponseData(BaseModel): + """ + CancelObjectStorageResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + object_storage_id: StrictStr = Field(description="Object Storage id", alias="objectStorageId") + cancel_date: date = Field(description="Cancellation date for object storage.", alias="cancelDate") + display_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Display name for object storage.", alias="displayName") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "objectStorageId", "cancelDate", "displayName"] + + 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 CancelObjectStorageResponseData 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 CancelObjectStorageResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "objectStorageId": obj.get("objectStorageId"), + "cancelDate": obj.get("cancelDate"), + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/pfruck_contabo/models/client_response.py b/pfruck_contabo/models/client_response.py new file mode 100644 index 0000000..67089f0 --- /dev/null +++ b/pfruck_contabo/models/client_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ClientResponse(BaseModel): + """ + ClientResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + id: StrictStr = Field(description="Client's id") + client_id: StrictStr = Field(description="IDM client id", alias="clientId") + secret: StrictStr = Field(description="IDM client secret") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "id", "clientId", "secret"] + + 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 ClientResponse 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 ClientResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "id": obj.get("id"), + "clientId": obj.get("clientId"), + "secret": obj.get("secret") + }) + return _obj + + diff --git a/pfruck_contabo/models/client_secret_response.py b/pfruck_contabo/models/client_secret_response.py new file mode 100644 index 0000000..33040d6 --- /dev/null +++ b/pfruck_contabo/models/client_secret_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ClientSecretResponse(BaseModel): + """ + ClientSecretResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + secret: StrictStr = Field(description="IDM client secret") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "secret"] + + 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 ClientSecretResponse 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 ClientSecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "secret": obj.get("secret") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_assignment_response.py b/pfruck_contabo/models/create_assignment_response.py new file mode 100644 index 0000000..68ce3aa --- /dev/null +++ b/pfruck_contabo/models/create_assignment_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.tag_assignment_self_links import TagAssignmentSelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateAssignmentResponse(BaseModel): + """ + CreateAssignmentResponse + """ # noqa: E501 + links: TagAssignmentSelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 CreateAssignmentResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateAssignmentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": TagAssignmentSelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_custom_image_fail_response.py b/pfruck_contabo/models/create_custom_image_fail_response.py new file mode 100644 index 0000000..bad8c4c --- /dev/null +++ b/pfruck_contabo/models/create_custom_image_fail_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class CreateCustomImageFailResponse(BaseModel): + """ + CreateCustomImageFailResponse + """ # noqa: E501 + message: StrictStr = Field(description="Unsupported Media Type: Please provide a direct link to an .iso or .qcow2 image.") + status_code: StrictInt = Field(description="statuscode:415", alias="statusCode") + __properties: ClassVar[List[str]] = ["message", "statusCode"] + + 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 CreateCustomImageFailResponse 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 CreateCustomImageFailResponse 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"), + "statusCode": obj.get("statusCode") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_custom_image_request.py b/pfruck_contabo/models/create_custom_image_request.py new file mode 100644 index 0000000..7110029 --- /dev/null +++ b/pfruck_contabo/models/create_custom_image_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 CreateCustomImageRequest(BaseModel): + """ + CreateCustomImageRequest + """ # noqa: E501 + name: StrictStr = Field(description="Image Name") + description: Optional[StrictStr] = Field(default=None, description="Image Description") + url: StrictStr = Field(description="URL from where the image has been downloaded / provided.") + os_type: StrictStr = Field(description="Provided type of operating system (OS). Please specify `Windows` for MS Windows and `Linux` for other OS. Specifying wrong OS type may lead to disfunctional cloud instance.", alias="osType") + version: StrictStr = Field(description="Version number to distinguish the contents of an image. Could be the version of the operating system for example.") + __properties: ClassVar[List[str]] = ["name", "description", "url", "osType", "version"] + + @field_validator('os_type') + def os_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Windows', 'Linux']): + raise ValueError("must be one of enum values ('Windows', 'Linux')") + 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 CreateCustomImageRequest 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 CreateCustomImageRequest 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"), + "url": obj.get("url"), + "osType": obj.get("osType"), + "version": obj.get("version") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_custom_image_response.py b/pfruck_contabo/models/create_custom_image_response.py new file mode 100644 index 0000000..0a10986 --- /dev/null +++ b/pfruck_contabo/models/create_custom_image_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.create_custom_image_response_data import CreateCustomImageResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateCustomImageResponse(BaseModel): + """ + CreateCustomImageResponse + """ # noqa: E501 + data: List[CreateCustomImageResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateCustomImageResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateCustomImageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CreateCustomImageResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_custom_image_response_data.py b/pfruck_contabo/models/create_custom_image_response_data.py new file mode 100644 index 0000000..677df1c --- /dev/null +++ b/pfruck_contabo/models/create_custom_image_response_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateCustomImageResponseData(BaseModel): + """ + CreateCustomImageResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + image_id: StrictStr = Field(description="Image's id", alias="imageId") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "imageId"] + + 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 CreateCustomImageResponseData 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 CreateCustomImageResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "imageId": obj.get("imageId") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_instance_addons.py b/pfruck_contabo/models/create_instance_addons.py new file mode 100644 index 0000000..2eedcac --- /dev/null +++ b/pfruck_contabo/models/create_instance_addons.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.add_on_request import AddOnRequest +from pfruck_contabo.models.extra_storage_request import ExtraStorageRequest +from typing import Optional, Set +from typing_extensions import Self + +class CreateInstanceAddons(BaseModel): + """ + CreateInstanceAddons + """ # noqa: E501 + private_networking: Optional[Dict[str, Any]] = Field(default=None, description="Set this attribute if you want to upgrade your instance with the Private Networking addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future.", alias="privateNetworking") + additional_ips: Optional[Dict[str, Any]] = Field(default=None, description="Set this attribute if you want to upgrade your instance with the Additional IPs addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future.", alias="additionalIps") + extra_storage: Optional[ExtraStorageRequest] = Field(default=None, description="Set this attribute if you want to upgrade your instance with the Extra Storage addon.", alias="extraStorage") + custom_image: Optional[Dict[str, Any]] = Field(default=None, description="Set this attribute if you want to upgrade your instance with the Custom Images addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future.", alias="customImage") + addons_ids: Optional[List[AddOnRequest]] = Field(default=None, alias="addonsIds") + __properties: ClassVar[List[str]] = ["privateNetworking", "additionalIps", "extraStorage", "customImage", "addonsIds"] + + 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 CreateInstanceAddons 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 extra_storage + if self.extra_storage: + _dict['extraStorage'] = self.extra_storage.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in addons_ids (list) + _items = [] + if self.addons_ids: + for _item in self.addons_ids: + if _item: + _items.append(_item.to_dict()) + _dict['addonsIds'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceAddons from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "privateNetworking": obj.get("privateNetworking"), + "additionalIps": obj.get("additionalIps"), + "extraStorage": ExtraStorageRequest.from_dict(obj["extraStorage"]) if obj.get("extraStorage") is not None else None, + "customImage": obj.get("customImage"), + "addonsIds": [AddOnRequest.from_dict(_item) for _item in obj["addonsIds"]] if obj.get("addonsIds") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_instance_request.py b/pfruck_contabo/models/create_instance_request.py new file mode 100644 index 0000000..35c3370 --- /dev/null +++ b/pfruck_contabo/models/create_instance_request.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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_extensions import Annotated +from pfruck_contabo.models.create_instance_addons import CreateInstanceAddons +from typing import Optional, Set +from typing_extensions import Self + +class CreateInstanceRequest(BaseModel): + """ + CreateInstanceRequest + """ # noqa: E501 + image_id: Optional[StrictStr] = Field(default='afecbb85-e2fc-46f0-9684-b46b1faf00bb', description="ImageId to be used to setup the compute instance. Default is Ubuntu 22.04", alias="imageId") + product_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default='V45', description="Default is V45", alias="productId") + region: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default='EU', description="Instance Region where the compute instance should be located. Default is EU") + ssh_keys: Optional[List[StrictInt]] = Field(default=None, description="Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API.", alias="sshKeys") + root_password: Optional[StrictInt] = Field(default=None, description="`secretId` of the password for the `defaultUser` with administrator/root privileges. For Linux/BSD please use SSH, for Windows RDP. Please refer to Secrets Management API.", alias="rootPassword") + user_data: Optional[StrictStr] = Field(default=None, description="[Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance.", alias="userData") + license: Optional[StrictStr] = Field(default=None, description="Additional licence in order to enhance your chosen product, mainly needed for software licenses on your product (not needed for windows).") + period: StrictInt = Field(description="Initial contract period in months. Available periods are: 1, 3, 6 and 12 months. Default to 1 month") + display_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The display name of the instance", alias="displayName") + default_user: Optional[StrictStr] = Field(default='admin', description="Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`.", alias="defaultUser") + add_ons: Optional[CreateInstanceAddons] = Field(default=None, description="Set attributes in the addons object for the corresponding ones that need to be added to the instance", alias="addOns") + application_id: Optional[StrictStr] = Field(default=None, description="Application ID", alias="applicationId") + __properties: ClassVar[List[str]] = ["imageId", "productId", "region", "sshKeys", "rootPassword", "userData", "license", "period", "displayName", "defaultUser", "addOns", "applicationId"] + + @field_validator('region') + def region_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['EU', 'US-central', 'US-east', 'US-west', 'SIN', 'UK', 'AUS', 'JPN']): + raise ValueError("must be one of enum values ('EU', 'US-central', 'US-east', 'US-west', 'SIN', 'UK', 'AUS', 'JPN')") + return value + + @field_validator('license') + def license_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['cPanel5', 'cPanel30', 'cPanel50', 'cPanel100', 'cPanel150', 'cPanel200', 'cPanel250', 'cPanel300', 'cPanel350', 'cPanel400', 'cPanel450', 'cPanel500', 'cPanel550', 'cPanel600', 'cPanel650', 'cPanel700', 'cPanel750', 'cPanel800', 'cPanel850', 'cPanel900', 'cPanel950', 'cPanel1000', 'PleskAdmin', 'PleskHost', 'PleskPro']): + raise ValueError("must be one of enum values ('cPanel5', 'cPanel30', 'cPanel50', 'cPanel100', 'cPanel150', 'cPanel200', 'cPanel250', 'cPanel300', 'cPanel350', 'cPanel400', 'cPanel450', 'cPanel500', 'cPanel550', 'cPanel600', 'cPanel650', 'cPanel700', 'cPanel750', 'cPanel800', 'cPanel850', 'cPanel900', 'cPanel950', 'cPanel1000', 'PleskAdmin', 'PleskHost', 'PleskPro')") + return value + + @field_validator('default_user') + def default_user_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['root', 'admin', 'administrator']): + raise ValueError("must be one of enum values ('root', 'admin', 'administrator')") + 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 CreateInstanceRequest 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 add_ons + if self.add_ons: + _dict['addOns'] = self.add_ons.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageId": obj.get("imageId") if obj.get("imageId") is not None else 'afecbb85-e2fc-46f0-9684-b46b1faf00bb', + "productId": obj.get("productId") if obj.get("productId") is not None else 'V45', + "region": obj.get("region") if obj.get("region") is not None else 'EU', + "sshKeys": obj.get("sshKeys"), + "rootPassword": obj.get("rootPassword"), + "userData": obj.get("userData"), + "license": obj.get("license"), + "period": obj.get("period") if obj.get("period") is not None else 1, + "displayName": obj.get("displayName"), + "defaultUser": obj.get("defaultUser") if obj.get("defaultUser") is not None else 'admin', + "addOns": CreateInstanceAddons.from_dict(obj["addOns"]) if obj.get("addOns") is not None else None, + "applicationId": obj.get("applicationId") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_instance_response.py b/pfruck_contabo/models/create_instance_response.py new file mode 100644 index 0000000..31e344a --- /dev/null +++ b/pfruck_contabo/models/create_instance_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.create_instance_response_data import CreateInstanceResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateInstanceResponse(BaseModel): + """ + CreateInstanceResponse + """ # noqa: E501 + data: List[CreateInstanceResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateInstanceResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CreateInstanceResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_instance_response_data.py b/pfruck_contabo/models/create_instance_response_data.py new file mode 100644 index 0000000..01b4755 --- /dev/null +++ b/pfruck_contabo/models/create_instance_response_data.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from pfruck_contabo.models.add_on_response import AddOnResponse +from pfruck_contabo.models.instance_status import InstanceStatus +from typing import Optional, Set +from typing_extensions import Self + +class CreateInstanceResponseData(BaseModel): + """ + CreateInstanceResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Instance's id", alias="instanceId") + created_date: datetime = Field(description="Creation date for instance", alias="createdDate") + image_id: StrictStr = Field(description="Image's id", alias="imageId") + product_id: StrictStr = Field(description="Product ID", alias="productId") + region: StrictStr = Field(description="Instance Region where the compute instance should be located.") + add_ons: List[AddOnResponse] = Field(alias="addOns") + os_type: StrictStr = Field(description="Type of operating system (OS)", alias="osType") + status: InstanceStatus + ssh_keys: List[StrictInt] = Field(description="Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API.", alias="sshKeys") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "createdDate", "imageId", "productId", "region", "addOns", "osType", "status", "sshKeys"] + + 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 CreateInstanceResponseData 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 add_ons (list) + _items = [] + if self.add_ons: + for _item in self.add_ons: + if _item: + _items.append(_item.to_dict()) + _dict['addOns'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateInstanceResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "createdDate": obj.get("createdDate"), + "imageId": obj.get("imageId"), + "productId": obj.get("productId"), + "region": obj.get("region"), + "addOns": [AddOnResponse.from_dict(_item) for _item in obj["addOns"]] if obj.get("addOns") is not None else None, + "osType": obj.get("osType"), + "status": obj.get("status"), + "sshKeys": obj.get("sshKeys") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_object_storage_request.py b/pfruck_contabo/models/create_object_storage_request.py new file mode 100644 index 0000000..f48aea6 --- /dev/null +++ b/pfruck_contabo/models/create_object_storage_request.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from pfruck_contabo.models.auto_scaling_type_request import AutoScalingTypeRequest +from typing import Optional, Set +from typing_extensions import Self + +class CreateObjectStorageRequest(BaseModel): + """ + CreateObjectStorageRequest + """ # noqa: E501 + region: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Region where the object storage should be located. Default is EU. Available regions: EU, US-central, SIN") + auto_scaling: Optional[AutoScalingTypeRequest] = Field(default=None, description="Autoscaling settings", alias="autoScaling") + total_purchased_space_tb: Union[StrictFloat, StrictInt] = Field(description="Amount of purchased / requested object storage in TB.", alias="totalPurchasedSpaceTB") + display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="Display name helps to differentiate between object storages, especially if they are in the same region. If display name is not provided, it will be generated. Display name can be changed any time.", alias="displayName") + __properties: ClassVar[List[str]] = ["region", "autoScaling", "totalPurchasedSpaceTB", "displayName"] + + 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 CreateObjectStorageRequest 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 auto_scaling + if self.auto_scaling: + _dict['autoScaling'] = self.auto_scaling.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateObjectStorageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "region": obj.get("region") if obj.get("region") is not None else 'EU', + "autoScaling": AutoScalingTypeRequest.from_dict(obj["autoScaling"]) if obj.get("autoScaling") is not None else None, + "totalPurchasedSpaceTB": obj.get("totalPurchasedSpaceTB"), + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_object_storage_response.py b/pfruck_contabo/models/create_object_storage_response.py new file mode 100644 index 0000000..9359c67 --- /dev/null +++ b/pfruck_contabo/models/create_object_storage_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.create_object_storage_response_data import CreateObjectStorageResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateObjectStorageResponse(BaseModel): + """ + CreateObjectStorageResponse + """ # noqa: E501 + data: List[CreateObjectStorageResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateObjectStorageResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateObjectStorageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CreateObjectStorageResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_object_storage_response_data.py b/pfruck_contabo/models/create_object_storage_response_data.py new file mode 100644 index 0000000..f20a75b --- /dev/null +++ b/pfruck_contabo/models/create_object_storage_response_data.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 date, datetime +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 pfruck_contabo.models.auto_scaling_type_response import AutoScalingTypeResponse +from typing import Optional, Set +from typing_extensions import Self + +class CreateObjectStorageResponseData(BaseModel): + """ + CreateObjectStorageResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + object_storage_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your object storage id", alias="objectStorageId") + created_date: datetime = Field(description="Creation date for object storage.", alias="createdDate") + cancel_date: date = Field(description="Cancellation date for object storage.", alias="cancelDate") + auto_scaling: AutoScalingTypeResponse = Field(description="Autoscaling settings", alias="autoScaling") + data_center: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The data center of the storage", alias="dataCenter") + total_purchased_space_tb: Union[StrictFloat, StrictInt] = Field(description="Amount of purchased / requested object storage in TB.", alias="totalPurchasedSpaceTB") + used_space_tb: Union[StrictFloat, StrictInt] = Field(description="Currently used space in TB.", alias="usedSpaceTB") + used_space_percentage: Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(description="Currently used space in percentage.", alias="usedSpacePercentage") + s3_url: StrictStr = Field(description="S3 URL to connect to your S3 compatible object storage", alias="s3Url") + s3_tenant_id: StrictStr = Field(description="Your S3 tenantId. Only required for public sharing.", alias="s3TenantId") + status: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The object storage status") + region: StrictStr = Field(description="The region where your object storage is located") + display_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Display name for object storage.", alias="displayName") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "objectStorageId", "createdDate", "cancelDate", "autoScaling", "dataCenter", "totalPurchasedSpaceTB", "usedSpaceTB", "usedSpacePercentage", "s3Url", "s3TenantId", "status", "region", "displayName"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['READY', 'PROVISIONING', 'UPGRADING', 'CANCELLED', 'ERROR', 'ENABLED', 'DISABLED', 'MANUAL_PROVISIONING', 'PRODUCT_NOT_AVAILABLE', 'LIMIT_EXCEEDED', 'VERIFICATION_REQUIRED', 'COMPLETED', 'ORDER_PROCESSING', 'PENDING_PAYMENT', 'UNKNOWN']): + raise ValueError("must be one of enum values ('READY', 'PROVISIONING', 'UPGRADING', 'CANCELLED', 'ERROR', 'ENABLED', 'DISABLED', 'MANUAL_PROVISIONING', 'PRODUCT_NOT_AVAILABLE', 'LIMIT_EXCEEDED', 'VERIFICATION_REQUIRED', 'COMPLETED', 'ORDER_PROCESSING', 'PENDING_PAYMENT', 'UNKNOWN')") + 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 CreateObjectStorageResponseData 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 auto_scaling + if self.auto_scaling: + _dict['autoScaling'] = self.auto_scaling.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateObjectStorageResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "objectStorageId": obj.get("objectStorageId"), + "createdDate": obj.get("createdDate"), + "cancelDate": obj.get("cancelDate"), + "autoScaling": AutoScalingTypeResponse.from_dict(obj["autoScaling"]) if obj.get("autoScaling") is not None else None, + "dataCenter": obj.get("dataCenter"), + "totalPurchasedSpaceTB": obj.get("totalPurchasedSpaceTB"), + "usedSpaceTB": obj.get("usedSpaceTB"), + "usedSpacePercentage": obj.get("usedSpacePercentage"), + "s3Url": obj.get("s3Url"), + "s3TenantId": obj.get("s3TenantId"), + "status": obj.get("status"), + "region": obj.get("region"), + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_private_network_request.py b/pfruck_contabo/models/create_private_network_request.py new file mode 100644 index 0000000..517f95d --- /dev/null +++ b/pfruck_contabo/models/create_private_network_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class CreatePrivateNetworkRequest(BaseModel): + """ + CreatePrivateNetworkRequest + """ # noqa: E501 + region: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default='EU', description="Region where the Private Network should be located. Default is `EU`") + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the Private Network. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per Private Network name.") + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The description of the Private Network. There is a limit of 255 characters per Private Network description.") + __properties: ClassVar[List[str]] = ["region", "name", "description"] + + 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 CreatePrivateNetworkRequest 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 CreatePrivateNetworkRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "region": obj.get("region") if obj.get("region") is not None else 'EU', + "name": obj.get("name"), + "description": obj.get("description") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_private_network_response.py b/pfruck_contabo/models/create_private_network_response.py new file mode 100644 index 0000000..beee8d0 --- /dev/null +++ b/pfruck_contabo/models/create_private_network_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.private_network_response import PrivateNetworkResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreatePrivateNetworkResponse(BaseModel): + """ + CreatePrivateNetworkResponse + """ # noqa: E501 + data: List[PrivateNetworkResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreatePrivateNetworkResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreatePrivateNetworkResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [PrivateNetworkResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_role_request.py b/pfruck_contabo/models/create_role_request.py new file mode 100644 index 0000000..40fb89f --- /dev/null +++ b/pfruck_contabo/models/create_role_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.permission_request import PermissionRequest +from typing import Optional, Set +from typing_extensions import Self + +class CreateRoleRequest(BaseModel): + """ + CreateRoleRequest + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the role. There is a limit of 255 characters per role.") + admin: StrictBool = Field(description="If user is admin he will have permissions to all API endpoints and resources. Enabling this will superseed all role definitions and `accessAllResources`.") + access_all_resources: StrictBool = Field(description="Allow access to all resources. This will superseed all assigned resources in a role.", alias="accessAllResources") + permissions: Optional[List[PermissionRequest]] = None + __properties: ClassVar[List[str]] = ["name", "admin", "accessAllResources", "permissions"] + + 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 CreateRoleRequest 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 permissions (list) + _items = [] + if self.permissions: + for _item in self.permissions: + if _item: + _items.append(_item.to_dict()) + _dict['permissions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateRoleRequest 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"), + "admin": obj.get("admin"), + "accessAllResources": obj.get("accessAllResources"), + "permissions": [PermissionRequest.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_role_response.py b/pfruck_contabo/models/create_role_response.py new file mode 100644 index 0000000..d559f4b --- /dev/null +++ b/pfruck_contabo/models/create_role_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.create_role_response_data import CreateRoleResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateRoleResponse(BaseModel): + """ + CreateRoleResponse + """ # noqa: E501 + data: List[CreateRoleResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateRoleResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateRoleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CreateRoleResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_role_response_data.py b/pfruck_contabo/models/create_role_response_data.py new file mode 100644 index 0000000..2ae7de2 --- /dev/null +++ b/pfruck_contabo/models/create_role_response_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateRoleResponseData(BaseModel): + """ + CreateRoleResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + role_id: StrictInt = Field(description="Role's id", alias="roleId") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "roleId"] + + 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 CreateRoleResponseData 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 CreateRoleResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "roleId": obj.get("roleId") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_secret_request.py b/pfruck_contabo/models/create_secret_request.py new file mode 100644 index 0000000..d7dc9ec --- /dev/null +++ b/pfruck_contabo/models/create_secret_request.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class CreateSecretRequest(BaseModel): + """ + CreateSecretRequest + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the secret that will keep the password") + value: Annotated[str, Field(min_length=8, strict=True)] = Field(description="The secret value that needs to be saved. In case of a password it must match a pattern with at least one upper and lower case character and either one number with two special characters `!@#$^&*?_~` or at least three numbers with one special character `!@#$^&*?_~`. This is expressed in the following regular expression: `^((?=.*?[A-Z]{1,})(?=.*?[a-z]{1,}))(((?=(?:[^d]*d){1})(?=([^^&*?_~]*[!@#$^&*?_~]){2,}))|((?=(?:[^d]*d){3})(?=.*?[!@#$^&*?_~]+))).{8,}$`") + type: StrictStr = Field(description="The type of the secret. Can be `password` or `ssh`") + __properties: ClassVar[List[str]] = ["name", "value", "type"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['password', 'ssh']): + raise ValueError("must be one of enum values ('password', 'ssh')") + 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 CreateSecretRequest 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 CreateSecretRequest 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"), + "value": obj.get("value"), + "type": obj.get("type") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_secret_response.py b/pfruck_contabo/models/create_secret_response.py new file mode 100644 index 0000000..18d99e8 --- /dev/null +++ b/pfruck_contabo/models/create_secret_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.secret_response import SecretResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateSecretResponse(BaseModel): + """ + CreateSecretResponse + """ # noqa: E501 + data: List[SecretResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateSecretResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [SecretResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_snapshot_request.py b/pfruck_contabo/models/create_snapshot_request.py new file mode 100644 index 0000000..b6d2ae6 --- /dev/null +++ b/pfruck_contabo/models/create_snapshot_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class CreateSnapshotRequest(BaseModel): + """ + CreateSnapshotRequest + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the snapshot. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot.") + description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The description of the snapshot. There is a limit of 255 characters per snapshot.") + __properties: ClassVar[List[str]] = ["name", "description"] + + 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 CreateSnapshotRequest 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 CreateSnapshotRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_snapshot_response.py b/pfruck_contabo/models/create_snapshot_response.py new file mode 100644 index 0000000..d439d83 --- /dev/null +++ b/pfruck_contabo/models/create_snapshot_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.snapshot_response import SnapshotResponse +from typing import Optional, Set +from typing_extensions import Self + +class CreateSnapshotResponse(BaseModel): + """ + CreateSnapshotResponse + """ # noqa: E501 + data: List[SnapshotResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateSnapshotResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [SnapshotResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_tag_request.py b/pfruck_contabo/models/create_tag_request.py new file mode 100644 index 0000000..12a533f --- /dev/null +++ b/pfruck_contabo/models/create_tag_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateTagRequest(BaseModel): + """ + CreateTagRequest + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag.") + color: Annotated[str, Field(min_length=4, strict=True, max_length=7)] = Field(description="The color of the tag. Color can be specified using hexadecimal value. Default color is #0A78C3") + __properties: ClassVar[List[str]] = ["name", "color"] + + 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 CreateTagRequest 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 CreateTagRequest 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"), + "color": obj.get("color") if obj.get("color") is not None else '#0A78C3' + }) + return _obj + + diff --git a/pfruck_contabo/models/create_tag_response.py b/pfruck_contabo/models/create_tag_response.py new file mode 100644 index 0000000..9721078 --- /dev/null +++ b/pfruck_contabo/models/create_tag_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.create_tag_response_data import CreateTagResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateTagResponse(BaseModel): + """ + CreateTagResponse + """ # noqa: E501 + data: List[CreateTagResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateTagResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateTagResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CreateTagResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_tag_response_data.py b/pfruck_contabo/models/create_tag_response_data.py new file mode 100644 index 0000000..100cd71 --- /dev/null +++ b/pfruck_contabo/models/create_tag_response_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateTagResponseData(BaseModel): + """ + CreateTagResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + tag_id: StrictInt = Field(description="Tag's id", alias="tagId") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "tagId"] + + 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 CreateTagResponseData 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 CreateTagResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "tagId": obj.get("tagId") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_ticket_request.py b/pfruck_contabo/models/create_ticket_request.py new file mode 100644 index 0000000..ce5c17b --- /dev/null +++ b/pfruck_contabo/models/create_ticket_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateTicketRequest(BaseModel): + """ + CreateTicketRequest + """ # noqa: E501 + subject: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The ticket subject") + note: Annotated[str, Field(min_length=1, strict=True)] = Field(description="The ticket note") + sender: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer email") + __properties: ClassVar[List[str]] = ["subject", "note", "sender"] + + 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 CreateTicketRequest 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 CreateTicketRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "subject": obj.get("subject"), + "note": obj.get("note"), + "sender": obj.get("sender") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_ticket_response.py b/pfruck_contabo/models/create_ticket_response.py new file mode 100644 index 0000000..79a68ea --- /dev/null +++ b/pfruck_contabo/models/create_ticket_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.create_ticket_response_data import CreateTicketResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateTicketResponse(BaseModel): + """ + CreateTicketResponse + """ # noqa: E501 + data: List[CreateTicketResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateTicketResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateTicketResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CreateTicketResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_ticket_response_data.py b/pfruck_contabo/models/create_ticket_response_data.py new file mode 100644 index 0000000..be2313c --- /dev/null +++ b/pfruck_contabo/models/create_ticket_response_data.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateTicketResponseData(BaseModel): + """ + CreateTicketResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + __properties: ClassVar[List[str]] = ["tenantId", "customerId"] + + 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 CreateTicketResponseData 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 CreateTicketResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_user_request.py b/pfruck_contabo/models/create_user_request.py new file mode 100644 index 0000000..e30b670 --- /dev/null +++ b/pfruck_contabo/models/create_user_request.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool, StrictInt, 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 CreateUserRequest(BaseModel): + """ + CreateUserRequest + """ # noqa: E501 + first_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The name of the user. Names may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user.", alias="firstName") + last_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The last name of the user. Users may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user.", alias="lastName") + email: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The email of the user to which activation and forgot password links are being sent to. There is a limit of 255 characters per email.") + enabled: StrictBool = Field(description="If user is not enabled, he can't login and thus use services any longer.") + totp: StrictBool = Field(description="Enable or disable two-factor authentication (2FA) via time based OTP.") + locale: StrictStr = Field(description="The locale of the user. This can be `de-DE`, `de`, `en-US`, `en`") + roles: Optional[List[StrictInt]] = Field(default=None, description="The roles as list of `roleId`s of the user.") + __properties: ClassVar[List[str]] = ["firstName", "lastName", "email", "enabled", "totp", "locale", "roles"] + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['de-DE', 'de', 'en-US', 'en']): + raise ValueError("must be one of enum values ('de-DE', 'de', 'en-US', 'en')") + 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 CreateUserRequest 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 CreateUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "firstName": obj.get("firstName"), + "lastName": obj.get("lastName"), + "email": obj.get("email"), + "enabled": obj.get("enabled"), + "totp": obj.get("totp"), + "locale": obj.get("locale"), + "roles": obj.get("roles") + }) + return _obj + + diff --git a/pfruck_contabo/models/create_user_response.py b/pfruck_contabo/models/create_user_response.py new file mode 100644 index 0000000..276d684 --- /dev/null +++ b/pfruck_contabo/models/create_user_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.create_user_response_data import CreateUserResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CreateUserResponse(BaseModel): + """ + CreateUserResponse + """ # noqa: E501 + data: List[CreateUserResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CreateUserResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateUserResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CreateUserResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/create_user_response_data.py b/pfruck_contabo/models/create_user_response_data.py new file mode 100644 index 0000000..f77c7e5 --- /dev/null +++ b/pfruck_contabo/models/create_user_response_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CreateUserResponseData(BaseModel): + """ + CreateUserResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + user_id: StrictStr = Field(description="User's id", alias="userId") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "userId"] + + 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 CreateUserResponseData 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 CreateUserResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "userId": obj.get("userId") + }) + return _obj + + diff --git a/pfruck_contabo/models/credential_data.py b/pfruck_contabo/models/credential_data.py new file mode 100644 index 0000000..592edf4 --- /dev/null +++ b/pfruck_contabo/models/credential_data.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CredentialData(BaseModel): + """ + CredentialData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + access_key: StrictStr = Field(description="Access key ID.", alias="accessKey") + secret_key: StrictStr = Field(description="Secret key ID.", alias="secretKey") + object_storage_id: StrictStr = Field(description="Object Storage ID.", alias="objectStorageId") + display_name: StrictStr = Field(description="Object Storage Name.", alias="displayName") + region: StrictStr = Field(description="Object Storage Region.") + credential_id: Union[StrictFloat, StrictInt] = Field(description="Object Storage Credential ID", alias="credentialId") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "accessKey", "secretKey", "objectStorageId", "displayName", "region", "credentialId"] + + 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 CredentialData 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 CredentialData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "accessKey": obj.get("accessKey"), + "secretKey": obj.get("secretKey"), + "objectStorageId": obj.get("objectStorageId"), + "displayName": obj.get("displayName"), + "region": obj.get("region"), + "credentialId": obj.get("credentialId") + }) + return _obj + + diff --git a/pfruck_contabo/models/custom_images_stats_response.py b/pfruck_contabo/models/custom_images_stats_response.py new file mode 100644 index 0000000..b871e1f --- /dev/null +++ b/pfruck_contabo/models/custom_images_stats_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.custom_images_stats_response_data import CustomImagesStatsResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class CustomImagesStatsResponse(BaseModel): + """ + CustomImagesStatsResponse + """ # noqa: E501 + data: List[CustomImagesStatsResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 CustomImagesStatsResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomImagesStatsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CustomImagesStatsResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/custom_images_stats_response_data.py b/pfruck_contabo/models/custom_images_stats_response_data.py new file mode 100644 index 0000000..1e90e63 --- /dev/null +++ b/pfruck_contabo/models/custom_images_stats_response_data.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class CustomImagesStatsResponseData(BaseModel): + """ + CustomImagesStatsResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + current_images_count: Union[StrictFloat, StrictInt] = Field(description="The number of existing custom images", alias="currentImagesCount") + total_size_mb: Union[StrictFloat, StrictInt] = Field(description="Total available disk space in MB", alias="totalSizeMb") + used_size_mb: Union[StrictFloat, StrictInt] = Field(description="Used disk space in MB", alias="usedSizeMb") + free_size_mb: Union[StrictFloat, StrictInt] = Field(description="Free disk space in MB", alias="freeSizeMb") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "currentImagesCount", "totalSizeMb", "usedSizeMb", "freeSizeMb"] + + 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 CustomImagesStatsResponseData 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 CustomImagesStatsResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "currentImagesCount": obj.get("currentImagesCount"), + "totalSizeMb": obj.get("totalSizeMb"), + "usedSizeMb": obj.get("usedSizeMb"), + "freeSizeMb": obj.get("freeSizeMb") + }) + return _obj + + diff --git a/pfruck_contabo/models/data_center_response.py b/pfruck_contabo/models/data_center_response.py new file mode 100644 index 0000000..366a4eb --- /dev/null +++ b/pfruck_contabo/models/data_center_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class DataCenterResponse(BaseModel): + """ + DataCenterResponse + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of the data center") + slug: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Slug of the data center") + capabilities: List[StrictStr] + s3_url: Annotated[str, Field(min_length=1, strict=True)] = Field(description="S3 URL of the data center", alias="s3Url") + region_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of the region", alias="regionName") + region_slug: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Slug of the region", alias="regionSlug") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + __properties: ClassVar[List[str]] = ["name", "slug", "capabilities", "s3Url", "regionName", "regionSlug", "tenantId", "customerId"] + + @field_validator('capabilities') + def capabilities_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['VPS', 'VDS', 'Object-Storage', 'Private-Networking']): + raise ValueError("each list item must be one of ('VPS', 'VDS', 'Object-Storage', 'Private-Networking')") + 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 DataCenterResponse 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 DataCenterResponse 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"), + "slug": obj.get("slug"), + "capabilities": obj.get("capabilities"), + "s3Url": obj.get("s3Url"), + "regionName": obj.get("regionName"), + "regionSlug": obj.get("regionSlug"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId") + }) + return _obj + + diff --git a/pfruck_contabo/models/extra_storage_request.py b/pfruck_contabo/models/extra_storage_request.py new file mode 100644 index 0000000..e380495 --- /dev/null +++ b/pfruck_contabo/models/extra_storage_request.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 ExtraStorageRequest(BaseModel): + """ + ExtraStorageRequest + """ # noqa: E501 + ssd: Optional[List[StrictStr]] = Field(default=None, description="Specify the size in TB and the quantity") + nvme: Optional[List[StrictStr]] = Field(default=None, description="Specify the size in TB and the quantity") + __properties: ClassVar[List[str]] = ["ssd", "nvme"] + + 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 ExtraStorageRequest 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 ExtraStorageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ssd": obj.get("ssd"), + "nvme": obj.get("nvme") + }) + return _obj + + diff --git a/pfruck_contabo/models/find_assignment_response.py b/pfruck_contabo/models/find_assignment_response.py new file mode 100644 index 0000000..7b31391 --- /dev/null +++ b/pfruck_contabo/models/find_assignment_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.assignment_response import AssignmentResponse +from pfruck_contabo.models.tag_assignment_self_links import TagAssignmentSelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindAssignmentResponse(BaseModel): + """ + FindAssignmentResponse + """ # noqa: E501 + data: List[AssignmentResponse] + links: TagAssignmentSelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindAssignmentResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindAssignmentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [AssignmentResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": TagAssignmentSelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_client_response.py b/pfruck_contabo/models/find_client_response.py new file mode 100644 index 0000000..7386975 --- /dev/null +++ b/pfruck_contabo/models/find_client_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.client_response import ClientResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindClientResponse(BaseModel): + """ + FindClientResponse + """ # noqa: E501 + data: List[ClientResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindClientResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindClientResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ClientResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_credential_response.py b/pfruck_contabo/models/find_credential_response.py new file mode 100644 index 0000000..e7ad0ad --- /dev/null +++ b/pfruck_contabo/models/find_credential_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.credential_data import CredentialData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindCredentialResponse(BaseModel): + """ + FindCredentialResponse + """ # noqa: E501 + data: List[CredentialData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindCredentialResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindCredentialResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [CredentialData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_image_response.py b/pfruck_contabo/models/find_image_response.py new file mode 100644 index 0000000..996c3f6 --- /dev/null +++ b/pfruck_contabo/models/find_image_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.image_response import ImageResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindImageResponse(BaseModel): + """ + FindImageResponse + """ # noqa: E501 + data: List[ImageResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindImageResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindImageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ImageResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_instance_response.py b/pfruck_contabo/models/find_instance_response.py new file mode 100644 index 0000000..15d4831 --- /dev/null +++ b/pfruck_contabo/models/find_instance_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_response import InstanceResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindInstanceResponse(BaseModel): + """ + FindInstanceResponse + """ # noqa: E501 + data: List[InstanceResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindInstanceResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindInstanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [InstanceResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_object_storage_response.py b/pfruck_contabo/models/find_object_storage_response.py new file mode 100644 index 0000000..09c5e90 --- /dev/null +++ b/pfruck_contabo/models/find_object_storage_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.object_storage_response import ObjectStorageResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindObjectStorageResponse(BaseModel): + """ + FindObjectStorageResponse + """ # noqa: E501 + data: List[ObjectStorageResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindObjectStorageResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindObjectStorageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ObjectStorageResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_private_network_response.py b/pfruck_contabo/models/find_private_network_response.py new file mode 100644 index 0000000..053c5c3 --- /dev/null +++ b/pfruck_contabo/models/find_private_network_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.private_network_response import PrivateNetworkResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindPrivateNetworkResponse(BaseModel): + """ + FindPrivateNetworkResponse + """ # noqa: E501 + data: List[PrivateNetworkResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindPrivateNetworkResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindPrivateNetworkResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [PrivateNetworkResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_role_response.py b/pfruck_contabo/models/find_role_response.py new file mode 100644 index 0000000..feedb11 --- /dev/null +++ b/pfruck_contabo/models/find_role_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.role_response import RoleResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindRoleResponse(BaseModel): + """ + FindRoleResponse + """ # noqa: E501 + data: List[RoleResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindRoleResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindRoleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [RoleResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_secret_response.py b/pfruck_contabo/models/find_secret_response.py new file mode 100644 index 0000000..84b1f14 --- /dev/null +++ b/pfruck_contabo/models/find_secret_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.secret_response import SecretResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class FindSecretResponse(BaseModel): + """ + FindSecretResponse + """ # noqa: E501 + data: List[SecretResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindSecretResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindSecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [SecretResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_snapshot_response.py b/pfruck_contabo/models/find_snapshot_response.py new file mode 100644 index 0000000..737a3a7 --- /dev/null +++ b/pfruck_contabo/models/find_snapshot_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.snapshot_response import SnapshotResponse +from typing import Optional, Set +from typing_extensions import Self + +class FindSnapshotResponse(BaseModel): + """ + FindSnapshotResponse + """ # noqa: E501 + data: List[SnapshotResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindSnapshotResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindSnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [SnapshotResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_tag_response.py b/pfruck_contabo/models/find_tag_response.py new file mode 100644 index 0000000..9711c50 --- /dev/null +++ b/pfruck_contabo/models/find_tag_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.tag_response import TagResponse +from typing import Optional, Set +from typing_extensions import Self + +class FindTagResponse(BaseModel): + """ + FindTagResponse + """ # noqa: E501 + data: List[TagResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindTagResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindTagResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [TagResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_user_is_password_set_response.py b/pfruck_contabo/models/find_user_is_password_set_response.py new file mode 100644 index 0000000..cbc04c8 --- /dev/null +++ b/pfruck_contabo/models/find_user_is_password_set_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.user_is_password_set_response import UserIsPasswordSetResponse +from typing import Optional, Set +from typing_extensions import Self + +class FindUserIsPasswordSetResponse(BaseModel): + """ + FindUserIsPasswordSetResponse + """ # noqa: E501 + data: List[UserIsPasswordSetResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindUserIsPasswordSetResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindUserIsPasswordSetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [UserIsPasswordSetResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_user_response.py b/pfruck_contabo/models/find_user_response.py new file mode 100644 index 0000000..1ac3688 --- /dev/null +++ b/pfruck_contabo/models/find_user_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.user_response import UserResponse +from typing import Optional, Set +from typing_extensions import Self + +class FindUserResponse(BaseModel): + """ + FindUserResponse + """ # noqa: E501 + data: List[UserResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindUserResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindUserResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [UserResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/find_vnc_response.py b/pfruck_contabo/models/find_vnc_response.py new file mode 100644 index 0000000..c01a478 --- /dev/null +++ b/pfruck_contabo/models/find_vnc_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.vnc_response import VncResponse +from typing import Optional, Set +from typing_extensions import Self + +class FindVncResponse(BaseModel): + """ + FindVncResponse + """ # noqa: E501 + data: List[VncResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 FindVncResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FindVncResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [VncResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/firewalling_upgrade_request.py b/pfruck_contabo/models/firewalling_upgrade_request.py new file mode 100644 index 0000000..c7deb42 --- /dev/null +++ b/pfruck_contabo/models/firewalling_upgrade_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 FirewallingUpgradeRequest(BaseModel): + """ + FirewallingUpgradeRequest + """ # noqa: E501 + assign_firewalls: Optional[List[StrictStr]] = Field(default=None, description="List of IDs of firewalls the upgraded instance should be assigned to immediately. If the list is empty or this property is not provided the instance will be assigned to your current default firewall.", alias="assignFirewalls") + __properties: ClassVar[List[str]] = ["assignFirewalls"] + + 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 FirewallingUpgradeRequest 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 FirewallingUpgradeRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "assignFirewalls": obj.get("assignFirewalls") + }) + return _obj + + diff --git a/pfruck_contabo/models/generate_client_secret_response.py b/pfruck_contabo/models/generate_client_secret_response.py new file mode 100644 index 0000000..de835b6 --- /dev/null +++ b/pfruck_contabo/models/generate_client_secret_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.client_secret_response import ClientSecretResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class GenerateClientSecretResponse(BaseModel): + """ + GenerateClientSecretResponse + """ # noqa: E501 + data: List[ClientSecretResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 GenerateClientSecretResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GenerateClientSecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ClientSecretResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/image_audit_response.py b/pfruck_contabo/models/image_audit_response.py new file mode 100644 index 0000000..3d2c417 --- /dev/null +++ b/pfruck_contabo/models/image_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.image_audit_response_data import ImageAuditResponseData +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ImageAuditResponse(BaseModel): + """ + ImageAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ImageAuditResponseData] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ImageAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ImageAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ImageAuditResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/image_audit_response_data.py b/pfruck_contabo/models/image_audit_response_data.py new file mode 100644 index 0000000..3122092 --- /dev/null +++ b/pfruck_contabo/models/image_audit_response_data.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, 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 ImageAuditResponseData(BaseModel): + """ + ImageAuditResponseData + """ # noqa: E501 + id: StrictInt = Field(description="The ID of the audit entry.") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Id of user who performed the change", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + image_id: StrictStr = Field(description="The identifier of the image", alias="imageId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "imageId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 ImageAuditResponseData 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 ImageAuditResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "imageId": obj.get("imageId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/image_response.py b/pfruck_contabo/models/image_response.py new file mode 100644 index 0000000..163847d --- /dev/null +++ b/pfruck_contabo/models/image_response.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ImageResponse(BaseModel): + """ + ImageResponse + """ # noqa: E501 + image_id: StrictStr = Field(description="Image's id", alias="imageId") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + name: StrictStr = Field(description="Image Name") + description: StrictStr = Field(description="Image Description") + url: StrictStr = Field(description="URL from where the image has been downloaded / provided.") + size_mb: Union[StrictFloat, StrictInt] = Field(description="Image Size in MB", alias="sizeMb") + uploaded_size_mb: Union[StrictFloat, StrictInt] = Field(description="Image Uploaded Size in MB", alias="uploadedSizeMb") + os_type: StrictStr = Field(description="Type of operating system (OS)", alias="osType") + version: StrictStr = Field(description="Version number to distinguish the contents of an image. Could be the version of the operating system for example.") + format: StrictStr = Field(description="Image format") + status: StrictStr = Field(description="Image status (e.g. if image is still downloading)") + error_message: StrictStr = Field(description="Image download error message", alias="errorMessage") + standard_image: StrictBool = Field(description="Flag indicating that image is either a standard (true) or a custom image (false)", alias="standardImage") + creation_date: datetime = Field(description="The creation date time for the image", alias="creationDate") + last_modified_date: datetime = Field(description="The last modified date time for the image", alias="lastModifiedDate") + __properties: ClassVar[List[str]] = ["imageId", "tenantId", "customerId", "name", "description", "url", "sizeMb", "uploadedSizeMb", "osType", "version", "format", "status", "errorMessage", "standardImage", "creationDate", "lastModifiedDate"] + + @field_validator('tenant_id') + def tenant_id_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DE', 'INT']): + raise ValueError("must be one of enum values ('DE', 'INT')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['iso', 'qcow2']): + raise ValueError("must be one of enum values ('iso', 'qcow2')") + 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 ImageResponse 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 ImageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageId": obj.get("imageId"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "name": obj.get("name"), + "description": obj.get("description"), + "url": obj.get("url"), + "sizeMb": obj.get("sizeMb"), + "uploadedSizeMb": obj.get("uploadedSizeMb"), + "osType": obj.get("osType"), + "version": obj.get("version"), + "format": obj.get("format"), + "status": obj.get("status"), + "errorMessage": obj.get("errorMessage"), + "standardImage": obj.get("standardImage"), + "creationDate": obj.get("creationDate"), + "lastModifiedDate": obj.get("lastModifiedDate") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_assignment_self_links.py b/pfruck_contabo/models/instance_assignment_self_links.py new file mode 100644 index 0000000..5b9e7f5 --- /dev/null +++ b/pfruck_contabo/models/instance_assignment_self_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 InstanceAssignmentSelfLinks(BaseModel): + """ + InstanceAssignmentSelfLinks + """ # noqa: E501 + var_self: StrictStr = Field(description="Link to current resource.", alias="self") + virtual_private_cloud: StrictStr = Field(description="Link to related Private Network.", alias="virtualPrivateCloud") + instance: StrictStr = Field(description="Link to assigned instance.") + __properties: ClassVar[List[str]] = ["self", "virtualPrivateCloud", "instance"] + + 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 InstanceAssignmentSelfLinks 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 InstanceAssignmentSelfLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": obj.get("self"), + "virtualPrivateCloud": obj.get("virtualPrivateCloud"), + "instance": obj.get("instance") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_rescue_action_response.py b/pfruck_contabo/models/instance_rescue_action_response.py new file mode 100644 index 0000000..05b628f --- /dev/null +++ b/pfruck_contabo/models/instance_rescue_action_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_rescue_action_response_data import InstanceRescueActionResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class InstanceRescueActionResponse(BaseModel): + """ + InstanceRescueActionResponse + """ # noqa: E501 + data: List[InstanceRescueActionResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 InstanceRescueActionResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceRescueActionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [InstanceRescueActionResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_rescue_action_response_data.py b/pfruck_contabo/models/instance_rescue_action_response_data.py new file mode 100644 index 0000000..0ddcf8e --- /dev/null +++ b/pfruck_contabo/models/instance_rescue_action_response_data.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class InstanceRescueActionResponseData(BaseModel): + """ + InstanceRescueActionResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Compute instance / resource id", alias="instanceId") + action: StrictStr = Field(description="Action that was triggered") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "action"] + + 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 InstanceRescueActionResponseData 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 InstanceRescueActionResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "action": obj.get("action") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_reset_password_action_response.py b/pfruck_contabo/models/instance_reset_password_action_response.py new file mode 100644 index 0000000..f524b29 --- /dev/null +++ b/pfruck_contabo/models/instance_reset_password_action_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_reset_password_action_response_data import InstanceResetPasswordActionResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class InstanceResetPasswordActionResponse(BaseModel): + """ + InstanceResetPasswordActionResponse + """ # noqa: E501 + data: List[InstanceResetPasswordActionResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 InstanceResetPasswordActionResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceResetPasswordActionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [InstanceResetPasswordActionResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_reset_password_action_response_data.py b/pfruck_contabo/models/instance_reset_password_action_response_data.py new file mode 100644 index 0000000..1dbaa72 --- /dev/null +++ b/pfruck_contabo/models/instance_reset_password_action_response_data.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class InstanceResetPasswordActionResponseData(BaseModel): + """ + InstanceResetPasswordActionResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Compute instance / resource id", alias="instanceId") + action: StrictStr = Field(description="Action that was triggered") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "action"] + + 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 InstanceResetPasswordActionResponseData 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 InstanceResetPasswordActionResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "action": obj.get("action") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_response.py b/pfruck_contabo/models/instance_response.py new file mode 100644 index 0000000..77e20a1 --- /dev/null +++ b/pfruck_contabo/models/instance_response.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from pfruck_contabo.models.add_on_response import AddOnResponse +from pfruck_contabo.models.additional_ip import AdditionalIp +from pfruck_contabo.models.instance_status import InstanceStatus +from pfruck_contabo.models.ip_config import IpConfig +from typing import Optional, Set +from typing_extensions import Self + +class InstanceResponse(BaseModel): + """ + InstanceResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + additional_ips: List[AdditionalIp] = Field(alias="additionalIps") + name: StrictStr = Field(description="Instance Name") + display_name: StrictStr = Field(description="Instance display name", alias="displayName") + instance_id: StrictInt = Field(description="Instance ID", alias="instanceId") + data_center: StrictStr = Field(description="The data center where your Private Network is located", alias="dataCenter") + region: StrictStr = Field(description="Instance region where the compute instance should be located.") + region_name: StrictStr = Field(description="The name of the region where the instance is located.", alias="regionName") + product_id: StrictStr = Field(description="Product ID", alias="productId") + image_id: StrictStr = Field(description="Image's id", alias="imageId") + ip_config: IpConfig = Field(alias="ipConfig") + mac_address: StrictStr = Field(description="MAC Address", alias="macAddress") + ram_mb: Union[StrictFloat, StrictInt] = Field(description="Image RAM size in MB", alias="ramMb") + cpu_cores: StrictInt = Field(description="CPU core count", alias="cpuCores") + os_type: StrictStr = Field(description="Type of operating system (OS)", alias="osType") + disk_mb: Union[StrictFloat, StrictInt] = Field(description="Image Disk size in MB", alias="diskMb") + ssh_keys: List[StrictInt] = Field(description="Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API.", alias="sshKeys") + created_date: datetime = Field(description="The creation date for the instance", alias="createdDate") + cancel_date: date = Field(description="The date on which the instance will be cancelled", alias="cancelDate") + status: InstanceStatus + v_host_id: StrictInt = Field(description="ID of host system", alias="vHostId") + v_host_number: StrictInt = Field(description="Number of host system", alias="vHostNumber") + v_host_name: StrictStr = Field(description="Name of host system", alias="vHostName") + add_ons: List[AddOnResponse] = Field(alias="addOns") + error_message: Optional[StrictStr] = Field(default=None, description="Message in case of an error.", alias="errorMessage") + product_type: StrictStr = Field(description="Instance's category depending on Product Id", alias="productType") + product_name: StrictStr = Field(description="Instance's Product Name", alias="productName") + default_user: Optional[StrictStr] = Field(default=None, description="Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`.", alias="defaultUser") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "additionalIps", "name", "displayName", "instanceId", "dataCenter", "region", "regionName", "productId", "imageId", "ipConfig", "macAddress", "ramMb", "cpuCores", "osType", "diskMb", "sshKeys", "createdDate", "cancelDate", "status", "vHostId", "vHostNumber", "vHostName", "addOns", "errorMessage", "productType", "productName", "defaultUser"] + + @field_validator('tenant_id') + def tenant_id_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DE', 'INT']): + raise ValueError("must be one of enum values ('DE', 'INT')") + return value + + @field_validator('cancel_date') + def cancel_date_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"yyyy-mm-dd", value): + raise ValueError(r"must validate the regular expression /yyyy-mm-dd/") + return value + + @field_validator('product_type') + def product_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['hdd', 'ssd', 'vds', 'nvme']): + raise ValueError("must be one of enum values ('hdd', 'ssd', 'vds', 'nvme')") + return value + + @field_validator('default_user') + def default_user_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['root', 'admin', 'administrator']): + raise ValueError("must be one of enum values ('root', 'admin', 'administrator')") + 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 InstanceResponse 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 additional_ips (list) + _items = [] + if self.additional_ips: + for _item in self.additional_ips: + if _item: + _items.append(_item.to_dict()) + _dict['additionalIps'] = _items + # override the default output from pydantic by calling `to_dict()` of ip_config + if self.ip_config: + _dict['ipConfig'] = self.ip_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in add_ons (list) + _items = [] + if self.add_ons: + for _item in self.add_ons: + if _item: + _items.append(_item.to_dict()) + _dict['addOns'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "additionalIps": [AdditionalIp.from_dict(_item) for _item in obj["additionalIps"]] if obj.get("additionalIps") is not None else None, + "name": obj.get("name"), + "displayName": obj.get("displayName"), + "instanceId": obj.get("instanceId"), + "dataCenter": obj.get("dataCenter"), + "region": obj.get("region"), + "regionName": obj.get("regionName"), + "productId": obj.get("productId"), + "imageId": obj.get("imageId"), + "ipConfig": IpConfig.from_dict(obj["ipConfig"]) if obj.get("ipConfig") is not None else None, + "macAddress": obj.get("macAddress"), + "ramMb": obj.get("ramMb"), + "cpuCores": obj.get("cpuCores"), + "osType": obj.get("osType"), + "diskMb": obj.get("diskMb"), + "sshKeys": obj.get("sshKeys"), + "createdDate": obj.get("createdDate"), + "cancelDate": obj.get("cancelDate"), + "status": obj.get("status"), + "vHostId": obj.get("vHostId"), + "vHostNumber": obj.get("vHostNumber"), + "vHostName": obj.get("vHostName"), + "addOns": [AddOnResponse.from_dict(_item) for _item in obj["addOns"]] if obj.get("addOns") is not None else None, + "errorMessage": obj.get("errorMessage"), + "productType": obj.get("productType"), + "productName": obj.get("productName"), + "defaultUser": obj.get("defaultUser") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_restart_action_response.py b/pfruck_contabo/models/instance_restart_action_response.py new file mode 100644 index 0000000..e4ee211 --- /dev/null +++ b/pfruck_contabo/models/instance_restart_action_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_restart_action_response_data import InstanceRestartActionResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class InstanceRestartActionResponse(BaseModel): + """ + InstanceRestartActionResponse + """ # noqa: E501 + data: List[InstanceRestartActionResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 InstanceRestartActionResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceRestartActionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [InstanceRestartActionResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_restart_action_response_data.py b/pfruck_contabo/models/instance_restart_action_response_data.py new file mode 100644 index 0000000..9eedfef --- /dev/null +++ b/pfruck_contabo/models/instance_restart_action_response_data.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class InstanceRestartActionResponseData(BaseModel): + """ + InstanceRestartActionResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Compute instance / resource id", alias="instanceId") + action: StrictStr = Field(description="Action that was triggered") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "action"] + + 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 InstanceRestartActionResponseData 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 InstanceRestartActionResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "action": obj.get("action") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_shutdown_action_response.py b/pfruck_contabo/models/instance_shutdown_action_response.py new file mode 100644 index 0000000..71ce189 --- /dev/null +++ b/pfruck_contabo/models/instance_shutdown_action_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_shutdown_action_response_data import InstanceShutdownActionResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class InstanceShutdownActionResponse(BaseModel): + """ + InstanceShutdownActionResponse + """ # noqa: E501 + data: List[InstanceShutdownActionResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 InstanceShutdownActionResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceShutdownActionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [InstanceShutdownActionResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_shutdown_action_response_data.py b/pfruck_contabo/models/instance_shutdown_action_response_data.py new file mode 100644 index 0000000..6879e09 --- /dev/null +++ b/pfruck_contabo/models/instance_shutdown_action_response_data.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class InstanceShutdownActionResponseData(BaseModel): + """ + InstanceShutdownActionResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Compute instance / resource id", alias="instanceId") + action: StrictStr = Field(description="Action that was triggered") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "action"] + + 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 InstanceShutdownActionResponseData 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 InstanceShutdownActionResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "action": obj.get("action") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_start_action_response.py b/pfruck_contabo/models/instance_start_action_response.py new file mode 100644 index 0000000..510d718 --- /dev/null +++ b/pfruck_contabo/models/instance_start_action_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_start_action_response_data import InstanceStartActionResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class InstanceStartActionResponse(BaseModel): + """ + InstanceStartActionResponse + """ # noqa: E501 + data: List[InstanceStartActionResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 InstanceStartActionResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceStartActionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [InstanceStartActionResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_start_action_response_data.py b/pfruck_contabo/models/instance_start_action_response_data.py new file mode 100644 index 0000000..8d58d3d --- /dev/null +++ b/pfruck_contabo/models/instance_start_action_response_data.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class InstanceStartActionResponseData(BaseModel): + """ + InstanceStartActionResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Compute instance / resource id", alias="instanceId") + action: StrictStr = Field(description="Action that was triggered") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "action"] + + 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 InstanceStartActionResponseData 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 InstanceStartActionResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "action": obj.get("action") + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_status.py b/pfruck_contabo/models/instance_status.py new file mode 100644 index 0000000..90607e5 --- /dev/null +++ b/pfruck_contabo/models/instance_status.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 InstanceStatus(str, Enum): + """ + InstanceStatus + """ + + """ + allowed enum values + """ + PROVISIONING = 'provisioning' + UNINSTALLED = 'uninstalled' + RUNNING = 'running' + STOPPED = 'stopped' + ERROR = 'error' + INSTALLING = 'installing' + UNKNOWN = 'unknown' + MANUAL_PROVISIONING = 'manual_provisioning' + PRODUCT_NOT_AVAILABLE = 'product_not_available' + VERIFICATION_REQUIRED = 'verification_required' + RESCUE = 'rescue' + PENDING_PAYMENT = 'pending_payment' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InstanceStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/pfruck_contabo/models/instance_stop_action_response.py b/pfruck_contabo/models/instance_stop_action_response.py new file mode 100644 index 0000000..e75e2e0 --- /dev/null +++ b/pfruck_contabo/models/instance_stop_action_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_stop_action_response_data import InstanceStopActionResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class InstanceStopActionResponse(BaseModel): + """ + InstanceStopActionResponse + """ # noqa: E501 + data: List[InstanceStopActionResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 InstanceStopActionResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InstanceStopActionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [InstanceStopActionResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/instance_stop_action_response_data.py b/pfruck_contabo/models/instance_stop_action_response_data.py new file mode 100644 index 0000000..a8327ef --- /dev/null +++ b/pfruck_contabo/models/instance_stop_action_response_data.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class InstanceStopActionResponseData(BaseModel): + """ + InstanceStopActionResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Compute instance / resource id", alias="instanceId") + action: StrictStr = Field(description="Action that was triggered") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "action"] + + 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 InstanceStopActionResponseData 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 InstanceStopActionResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "action": obj.get("action") + }) + return _obj + + diff --git a/pfruck_contabo/models/instances.py b/pfruck_contabo/models/instances.py new file mode 100644 index 0000000..f2c0fe1 --- /dev/null +++ b/pfruck_contabo/models/instances.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.ip_config import IpConfig +from pfruck_contabo.models.private_ip_config import PrivateIpConfig +from typing import Optional, Set +from typing_extensions import Self + +class Instances(BaseModel): + """ + Instances + """ # noqa: E501 + instance_id: StrictInt = Field(description="Instance id", alias="instanceId") + display_name: StrictStr = Field(description="Instance display name", alias="displayName") + name: StrictStr = Field(description="Instance name") + product_id: StrictStr = Field(description="Product id", alias="productId") + private_ip_config: PrivateIpConfig = Field(alias="privateIpConfig") + ip_config: IpConfig = Field(alias="ipConfig") + status: StrictStr = Field(description="State of the instance in the Private Network") + error_message: Optional[StrictStr] = Field(default=None, description="Message in case of an error.", alias="errorMessage") + __properties: ClassVar[List[str]] = ["instanceId", "displayName", "name", "productId", "privateIpConfig", "ipConfig", "status", "errorMessage"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ok', 'restart', 'reinstall', 'reinstallation failed', 'installing']): + raise ValueError("must be one of enum values ('ok', 'restart', 'reinstall', 'reinstallation failed', 'installing')") + 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 Instances 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 private_ip_config + if self.private_ip_config: + _dict['privateIpConfig'] = self.private_ip_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of ip_config + if self.ip_config: + _dict['ipConfig'] = self.ip_config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Instances from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instanceId": obj.get("instanceId"), + "displayName": obj.get("displayName"), + "name": obj.get("name"), + "productId": obj.get("productId"), + "privateIpConfig": PrivateIpConfig.from_dict(obj["privateIpConfig"]) if obj.get("privateIpConfig") is not None else None, + "ipConfig": IpConfig.from_dict(obj["ipConfig"]) if obj.get("ipConfig") is not None else None, + "status": obj.get("status"), + "errorMessage": obj.get("errorMessage") + }) + return _obj + + diff --git a/pfruck_contabo/models/instances_actions_audit_response.py b/pfruck_contabo/models/instances_actions_audit_response.py new file mode 100644 index 0000000..fd23775 --- /dev/null +++ b/pfruck_contabo/models/instances_actions_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, 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 InstancesActionsAuditResponse(BaseModel): + """ + InstancesActionsAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The ID of the audit entry.") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Id of user who performed the change", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + instance_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The identifier of the instancesActions", alias="instanceId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "instanceId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 InstancesActionsAuditResponse 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 InstancesActionsAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "instanceId": obj.get("instanceId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/instances_actions_rescue_request.py b/pfruck_contabo/models/instances_actions_rescue_request.py new file mode 100644 index 0000000..71efd8f --- /dev/null +++ b/pfruck_contabo/models/instances_actions_rescue_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 InstancesActionsRescueRequest(BaseModel): + """ + InstancesActionsRescueRequest + """ # noqa: E501 + root_password: Optional[StrictInt] = Field(default=None, description="`secretId` of the password to login into rescue system for the `root` user.", alias="rootPassword") + ssh_keys: Optional[List[StrictInt]] = Field(default=None, description="Array of `secretId`s of public SSH keys for logging into rescue system as `root` user.", alias="sshKeys") + user_data: Optional[StrictStr] = Field(default=None, description="[Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance.", alias="userData") + __properties: ClassVar[List[str]] = ["rootPassword", "sshKeys", "userData"] + + 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 InstancesActionsRescueRequest 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 InstancesActionsRescueRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rootPassword": obj.get("rootPassword"), + "sshKeys": obj.get("sshKeys"), + "userData": obj.get("userData") + }) + return _obj + + diff --git a/pfruck_contabo/models/instances_audit_response.py b/pfruck_contabo/models/instances_audit_response.py new file mode 100644 index 0000000..9a45b53 --- /dev/null +++ b/pfruck_contabo/models/instances_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, 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 InstancesAuditResponse(BaseModel): + """ + InstancesAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The ID of the audit entry.") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Id of user who performed the change", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + instance_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The identifier of the instance", alias="instanceId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "instanceId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 InstancesAuditResponse 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 InstancesAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "instanceId": obj.get("instanceId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/instances_reset_password_actions_request.py b/pfruck_contabo/models/instances_reset_password_actions_request.py new file mode 100644 index 0000000..bb209ec --- /dev/null +++ b/pfruck_contabo/models/instances_reset_password_actions_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 InstancesResetPasswordActionsRequest(BaseModel): + """ + InstancesResetPasswordActionsRequest + """ # noqa: E501 + ssh_keys: Optional[List[StrictInt]] = Field(default=None, description="Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API.", alias="sshKeys") + root_password: Optional[StrictInt] = Field(default=None, description="`secretId` of the password for the `defaultUser` with administrator/root privileges. For Linux/BSD please use SSH, for Windows RDP. Please refer to Secrets Management API.", alias="rootPassword") + user_data: Optional[StrictStr] = Field(default=None, description="[Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance.", alias="userData") + __properties: ClassVar[List[str]] = ["sshKeys", "rootPassword", "userData"] + + 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 InstancesResetPasswordActionsRequest 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 InstancesResetPasswordActionsRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sshKeys": obj.get("sshKeys"), + "rootPassword": obj.get("rootPassword"), + "userData": obj.get("userData") + }) + return _obj + + diff --git a/pfruck_contabo/models/ip_config.py b/pfruck_contabo/models/ip_config.py new file mode 100644 index 0000000..94fc622 --- /dev/null +++ b/pfruck_contabo/models/ip_config.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.ip_v4 import IpV4 +from pfruck_contabo.models.ip_v6 import IpV6 +from typing import Optional, Set +from typing_extensions import Self + +class IpConfig(BaseModel): + """ + IpConfig + """ # noqa: E501 + v4: IpV4 + v6: IpV6 + __properties: ClassVar[List[str]] = ["v4", "v6"] + + 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 IpConfig 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 v4 + if self.v4: + _dict['v4'] = self.v4.to_dict() + # override the default output from pydantic by calling `to_dict()` of v6 + if self.v6: + _dict['v6'] = self.v6.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IpConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "v4": IpV4.from_dict(obj["v4"]) if obj.get("v4") is not None else None, + "v6": IpV6.from_dict(obj["v6"]) if obj.get("v6") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/ip_v4.py b/pfruck_contabo/models/ip_v4.py new file mode 100644 index 0000000..a68f74a --- /dev/null +++ b/pfruck_contabo/models/ip_v4.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class IpV4(BaseModel): + """ + IpV4 + """ # noqa: E501 + ip: StrictStr = Field(description="IP Address") + netmask_cidr: StrictInt = Field(description="Netmask CIDR", alias="netmaskCidr") + gateway: StrictStr = Field(description="Gateway") + __properties: ClassVar[List[str]] = ["ip", "netmaskCidr", "gateway"] + + 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 IpV4 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 IpV4 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ip": obj.get("ip"), + "netmaskCidr": obj.get("netmaskCidr"), + "gateway": obj.get("gateway") + }) + return _obj + + diff --git a/pfruck_contabo/models/ip_v6.py b/pfruck_contabo/models/ip_v6.py new file mode 100644 index 0000000..f9f8506 --- /dev/null +++ b/pfruck_contabo/models/ip_v6.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class IpV6(BaseModel): + """ + IpV6 + """ # noqa: E501 + ip: StrictStr = Field(description="IP Address") + netmask_cidr: StrictInt = Field(description="Netmask CIDR", alias="netmaskCidr") + gateway: StrictStr = Field(description="Gateway") + __properties: ClassVar[List[str]] = ["ip", "netmaskCidr", "gateway"] + + 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 IpV6 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 IpV6 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ip": obj.get("ip"), + "netmaskCidr": obj.get("netmaskCidr"), + "gateway": obj.get("gateway") + }) + return _obj + + diff --git a/pfruck_contabo/models/links.py b/pfruck_contabo/models/links.py new file mode 100644 index 0000000..98155bd --- /dev/null +++ b/pfruck_contabo/models/links.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 Links(BaseModel): + """ + Links + """ # noqa: E501 + var_self: StrictStr = Field(description="Link to current resource.", alias="self") + first: StrictStr = Field(description="Link to first page, if applicable.") + previous: Optional[StrictStr] = Field(default=None, description="Link to previous page, if applicable.") + next: Optional[StrictStr] = Field(default=None, description="Link to next page, if applicable.") + last: StrictStr = Field(description="Link to last page, if applicable.") + __properties: ClassVar[List[str]] = ["self", "first", "previous", "next", "last"] + + 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 Links 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 Links from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": obj.get("self"), + "first": obj.get("first"), + "previous": obj.get("previous"), + "next": obj.get("next"), + "last": obj.get("last") + }) + return _obj + + diff --git a/pfruck_contabo/models/list_api_permission_response.py b/pfruck_contabo/models/list_api_permission_response.py new file mode 100644 index 0000000..0a98ea2 --- /dev/null +++ b/pfruck_contabo/models/list_api_permission_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.api_permissions_response import ApiPermissionsResponse +from pfruck_contabo.models.links import Links +from typing import Optional, Set +from typing_extensions import Self + +class ListApiPermissionResponse(BaseModel): + """ + ListApiPermissionResponse + """ # noqa: E501 + data: List[ApiPermissionsResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 ListApiPermissionResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListApiPermissionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ApiPermissionsResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_applications_response.py b/pfruck_contabo/models/list_applications_response.py new file mode 100644 index 0000000..82480d1 --- /dev/null +++ b/pfruck_contabo/models/list_applications_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.application_response import ApplicationResponse +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListApplicationsResponse(BaseModel): + """ + ListApplicationsResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ApplicationResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListApplicationsResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListApplicationsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ApplicationResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_assignment_audits_response.py b/pfruck_contabo/models/list_assignment_audits_response.py new file mode 100644 index 0000000..5d3e0c6 --- /dev/null +++ b/pfruck_contabo/models/list_assignment_audits_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.assignment_audit_response import AssignmentAuditResponse +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListAssignmentAuditsResponse(BaseModel): + """ + ListAssignmentAuditsResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[AssignmentAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListAssignmentAuditsResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListAssignmentAuditsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [AssignmentAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_assignment_response.py b/pfruck_contabo/models/list_assignment_response.py new file mode 100644 index 0000000..dbdf119 --- /dev/null +++ b/pfruck_contabo/models/list_assignment_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.assignment_response import AssignmentResponse +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListAssignmentResponse(BaseModel): + """ + ListAssignmentResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[AssignmentResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListAssignmentResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListAssignmentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [AssignmentResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_credential_response.py b/pfruck_contabo/models/list_credential_response.py new file mode 100644 index 0000000..03cf304 --- /dev/null +++ b/pfruck_contabo/models/list_credential_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.credential_data import CredentialData +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListCredentialResponse(BaseModel): + """ + ListCredentialResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[CredentialData] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListCredentialResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListCredentialResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [CredentialData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_data_center_response.py b/pfruck_contabo/models/list_data_center_response.py new file mode 100644 index 0000000..cfb1865 --- /dev/null +++ b/pfruck_contabo/models/list_data_center_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.data_center_response import DataCenterResponse +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListDataCenterResponse(BaseModel): + """ + ListDataCenterResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[DataCenterResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListDataCenterResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListDataCenterResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [DataCenterResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_image_response.py b/pfruck_contabo/models/list_image_response.py new file mode 100644 index 0000000..362c9e9 --- /dev/null +++ b/pfruck_contabo/models/list_image_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.list_image_response_data import ListImageResponseData +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListImageResponse(BaseModel): + """ + ListImageResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ListImageResponseData] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListImageResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListImageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ListImageResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_image_response_data.py b/pfruck_contabo/models/list_image_response_data.py new file mode 100644 index 0000000..1d1eaa5 --- /dev/null +++ b/pfruck_contabo/models/list_image_response_data.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from pfruck_contabo.models.assigned_tag_response import AssignedTagResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListImageResponseData(BaseModel): + """ + ListImageResponseData + """ # noqa: E501 + image_id: StrictStr = Field(description="Image's id", alias="imageId") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + name: StrictStr = Field(description="Image Name") + description: StrictStr = Field(description="Image Description") + url: StrictStr = Field(description="URL from where the image has been downloaded / provided.") + size_mb: Union[StrictFloat, StrictInt] = Field(description="Image Size in MB", alias="sizeMb") + uploaded_size_mb: Union[StrictFloat, StrictInt] = Field(description="Image Uploaded Size in MB", alias="uploadedSizeMb") + os_type: StrictStr = Field(description="Type of operating system (OS)", alias="osType") + version: StrictStr = Field(description="Version number to distinguish the contents of an image. Could be the version of the operating system for example.") + format: StrictStr = Field(description="Image format") + status: StrictStr = Field(description="Image status (e.g. if image is still downloading)") + error_message: StrictStr = Field(description="Image download error message", alias="errorMessage") + standard_image: StrictBool = Field(description="Flag indicating that image is either a standard (true) or a custom image (false)", alias="standardImage") + creation_date: datetime = Field(description="The creation date time for the image", alias="creationDate") + last_modified_date: datetime = Field(description="The last modified date time for the image", alias="lastModifiedDate") + tags: List[AssignedTagResponse] = Field(description="The tags assigned to the image") + __properties: ClassVar[List[str]] = ["imageId", "tenantId", "customerId", "name", "description", "url", "sizeMb", "uploadedSizeMb", "osType", "version", "format", "status", "errorMessage", "standardImage", "creationDate", "lastModifiedDate", "tags"] + + @field_validator('tenant_id') + def tenant_id_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DE', 'INT']): + raise ValueError("must be one of enum values ('DE', 'INT')") + return value + + @field_validator('format') + def format_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['iso', 'qcow2']): + raise ValueError("must be one of enum values ('iso', 'qcow2')") + 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 ListImageResponseData 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 tags (list) + _items = [] + if self.tags: + for _item in self.tags: + if _item: + _items.append(_item.to_dict()) + _dict['tags'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListImageResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageId": obj.get("imageId"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "name": obj.get("name"), + "description": obj.get("description"), + "url": obj.get("url"), + "sizeMb": obj.get("sizeMb"), + "uploadedSizeMb": obj.get("uploadedSizeMb"), + "osType": obj.get("osType"), + "version": obj.get("version"), + "format": obj.get("format"), + "status": obj.get("status"), + "errorMessage": obj.get("errorMessage"), + "standardImage": obj.get("standardImage"), + "creationDate": obj.get("creationDate"), + "lastModifiedDate": obj.get("lastModifiedDate"), + "tags": [AssignedTagResponse.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_instances_actions_audit_response.py b/pfruck_contabo/models/list_instances_actions_audit_response.py new file mode 100644 index 0000000..3303180 --- /dev/null +++ b/pfruck_contabo/models/list_instances_actions_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instances_actions_audit_response import InstancesActionsAuditResponse +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListInstancesActionsAuditResponse(BaseModel): + """ + ListInstancesActionsAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[InstancesActionsAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListInstancesActionsAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstancesActionsAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [InstancesActionsAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_instances_audit_response.py b/pfruck_contabo/models/list_instances_audit_response.py new file mode 100644 index 0000000..9d55539 --- /dev/null +++ b/pfruck_contabo/models/list_instances_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instances_audit_response import InstancesAuditResponse +from pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListInstancesAuditResponse(BaseModel): + """ + ListInstancesAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[InstancesAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListInstancesAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstancesAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [InstancesAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_instances_response.py b/pfruck_contabo/models/list_instances_response.py new file mode 100644 index 0000000..98c014f --- /dev/null +++ b/pfruck_contabo/models/list_instances_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.list_instances_response_data import ListInstancesResponseData +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListInstancesResponse(BaseModel): + """ + ListInstancesResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ListInstancesResponseData] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListInstancesResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstancesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ListInstancesResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_instances_response_data.py b/pfruck_contabo/models/list_instances_response_data.py new file mode 100644 index 0000000..e252e08 --- /dev/null +++ b/pfruck_contabo/models/list_instances_response_data.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 date, datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from pfruck_contabo.models.add_on_response import AddOnResponse +from pfruck_contabo.models.additional_ip import AdditionalIp +from pfruck_contabo.models.instance_status import InstanceStatus +from pfruck_contabo.models.ip_config import IpConfig +from typing import Optional, Set +from typing_extensions import Self + +class ListInstancesResponseData(BaseModel): + """ + ListInstancesResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + additional_ips: List[AdditionalIp] = Field(alias="additionalIps") + name: StrictStr = Field(description="Instance Name") + display_name: StrictStr = Field(description="Instance display name", alias="displayName") + instance_id: StrictInt = Field(description="Instance ID", alias="instanceId") + data_center: StrictStr = Field(description="The data center where your Private Network is located", alias="dataCenter") + region: StrictStr = Field(description="Instance region where the compute instance should be located.") + region_name: StrictStr = Field(description="The name of the region where the instance is located.", alias="regionName") + product_id: StrictStr = Field(description="Product ID", alias="productId") + image_id: StrictStr = Field(description="Image's id", alias="imageId") + ip_config: IpConfig = Field(alias="ipConfig") + mac_address: StrictStr = Field(description="MAC Address", alias="macAddress") + ram_mb: Union[StrictFloat, StrictInt] = Field(description="Image RAM size in MB", alias="ramMb") + cpu_cores: StrictInt = Field(description="CPU core count", alias="cpuCores") + os_type: StrictStr = Field(description="Type of operating system (OS)", alias="osType") + disk_mb: Union[StrictFloat, StrictInt] = Field(description="Image Disk size in MB", alias="diskMb") + ssh_keys: List[StrictInt] = Field(description="Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API.", alias="sshKeys") + created_date: datetime = Field(description="The creation date for the instance", alias="createdDate") + cancel_date: date = Field(description="The date on which the instance will be cancelled", alias="cancelDate") + status: InstanceStatus + v_host_id: StrictInt = Field(description="ID of host system", alias="vHostId") + v_host_number: StrictInt = Field(description="Number of host system", alias="vHostNumber") + v_host_name: StrictStr = Field(description="Name of host system", alias="vHostName") + add_ons: List[AddOnResponse] = Field(alias="addOns") + error_message: Optional[StrictStr] = Field(default=None, description="Message in case of an error.", alias="errorMessage") + product_type: StrictStr = Field(description="Instance's category depending on Product Id", alias="productType") + product_name: StrictStr = Field(description="Instance's Product Name", alias="productName") + default_user: Optional[StrictStr] = Field(default=None, description="Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`.", alias="defaultUser") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "additionalIps", "name", "displayName", "instanceId", "dataCenter", "region", "regionName", "productId", "imageId", "ipConfig", "macAddress", "ramMb", "cpuCores", "osType", "diskMb", "sshKeys", "createdDate", "cancelDate", "status", "vHostId", "vHostNumber", "vHostName", "addOns", "errorMessage", "productType", "productName", "defaultUser"] + + @field_validator('tenant_id') + def tenant_id_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DE', 'INT']): + raise ValueError("must be one of enum values ('DE', 'INT')") + return value + + @field_validator('cancel_date') + def cancel_date_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"yyyy-mm-dd", value): + raise ValueError(r"must validate the regular expression /yyyy-mm-dd/") + return value + + @field_validator('product_type') + def product_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['hdd', 'ssd', 'vds', 'nvme']): + raise ValueError("must be one of enum values ('hdd', 'ssd', 'vds', 'nvme')") + return value + + @field_validator('default_user') + def default_user_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['root', 'admin', 'administrator']): + raise ValueError("must be one of enum values ('root', 'admin', 'administrator')") + 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 ListInstancesResponseData 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 additional_ips (list) + _items = [] + if self.additional_ips: + for _item in self.additional_ips: + if _item: + _items.append(_item.to_dict()) + _dict['additionalIps'] = _items + # override the default output from pydantic by calling `to_dict()` of ip_config + if self.ip_config: + _dict['ipConfig'] = self.ip_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in add_ons (list) + _items = [] + if self.add_ons: + for _item in self.add_ons: + if _item: + _items.append(_item.to_dict()) + _dict['addOns'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListInstancesResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "additionalIps": [AdditionalIp.from_dict(_item) for _item in obj["additionalIps"]] if obj.get("additionalIps") is not None else None, + "name": obj.get("name"), + "displayName": obj.get("displayName"), + "instanceId": obj.get("instanceId"), + "dataCenter": obj.get("dataCenter"), + "region": obj.get("region"), + "regionName": obj.get("regionName"), + "productId": obj.get("productId"), + "imageId": obj.get("imageId"), + "ipConfig": IpConfig.from_dict(obj["ipConfig"]) if obj.get("ipConfig") is not None else None, + "macAddress": obj.get("macAddress"), + "ramMb": obj.get("ramMb"), + "cpuCores": obj.get("cpuCores"), + "osType": obj.get("osType"), + "diskMb": obj.get("diskMb"), + "sshKeys": obj.get("sshKeys"), + "createdDate": obj.get("createdDate"), + "cancelDate": obj.get("cancelDate"), + "status": obj.get("status"), + "vHostId": obj.get("vHostId"), + "vHostNumber": obj.get("vHostNumber"), + "vHostName": obj.get("vHostName"), + "addOns": [AddOnResponse.from_dict(_item) for _item in obj["addOns"]] if obj.get("addOns") is not None else None, + "errorMessage": obj.get("errorMessage"), + "productType": obj.get("productType"), + "productName": obj.get("productName"), + "defaultUser": obj.get("defaultUser") + }) + return _obj + + diff --git a/pfruck_contabo/models/list_object_storage_audit_response.py b/pfruck_contabo/models/list_object_storage_audit_response.py new file mode 100644 index 0000000..5bcbb7b --- /dev/null +++ b/pfruck_contabo/models/list_object_storage_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.object_storage_audit_response import ObjectStorageAuditResponse +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListObjectStorageAuditResponse(BaseModel): + """ + ListObjectStorageAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ObjectStorageAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListObjectStorageAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListObjectStorageAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ObjectStorageAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_object_storage_response.py b/pfruck_contabo/models/list_object_storage_response.py new file mode 100644 index 0000000..cc3c29a --- /dev/null +++ b/pfruck_contabo/models/list_object_storage_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.object_storage_response import ObjectStorageResponse +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListObjectStorageResponse(BaseModel): + """ + ListObjectStorageResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ObjectStorageResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListObjectStorageResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListObjectStorageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ObjectStorageResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_private_network_audit_response.py b/pfruck_contabo/models/list_private_network_audit_response.py new file mode 100644 index 0000000..ed91907 --- /dev/null +++ b/pfruck_contabo/models/list_private_network_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.private_network_audit_response import PrivateNetworkAuditResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListPrivateNetworkAuditResponse(BaseModel): + """ + ListPrivateNetworkAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[PrivateNetworkAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListPrivateNetworkAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListPrivateNetworkAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [PrivateNetworkAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_private_network_response.py b/pfruck_contabo/models/list_private_network_response.py new file mode 100644 index 0000000..337f2ec --- /dev/null +++ b/pfruck_contabo/models/list_private_network_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.list_private_network_response_data import ListPrivateNetworkResponseData +from pfruck_contabo.models.pagination_meta import PaginationMeta +from typing import Optional, Set +from typing_extensions import Self + +class ListPrivateNetworkResponse(BaseModel): + """ + ListPrivateNetworkResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[ListPrivateNetworkResponseData] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListPrivateNetworkResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListPrivateNetworkResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [ListPrivateNetworkResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_private_network_response_data.py b/pfruck_contabo/models/list_private_network_response_data.py new file mode 100644 index 0000000..26e572f --- /dev/null +++ b/pfruck_contabo/models/list_private_network_response_data.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from pfruck_contabo.models.instances import Instances +from typing import Optional, Set +from typing_extensions import Self + +class ListPrivateNetworkResponseData(BaseModel): + """ + ListPrivateNetworkResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + private_network_id: StrictInt = Field(description="Private Network's id", alias="privateNetworkId") + data_center: StrictStr = Field(description="The data center where your Private Network is located", alias="dataCenter") + region: StrictStr = Field(description="The slug of the region where your Private Network is located") + region_name: StrictStr = Field(description="The region where your Private Network is located", alias="regionName") + name: StrictStr = Field(description="The name of the Private Network") + description: StrictStr = Field(description="The description of the Private Network") + cidr: StrictStr = Field(description="The cidr range of the Private Network") + available_ips: StrictInt = Field(description="The total available IPs of the Private Network", alias="availableIps") + created_date: datetime = Field(description="The creation date of the Private Network", alias="createdDate") + instances: List[Instances] + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "privateNetworkId", "dataCenter", "region", "regionName", "name", "description", "cidr", "availableIps", "createdDate", "instances"] + + 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 ListPrivateNetworkResponseData 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 instances (list) + _items = [] + if self.instances: + for _item in self.instances: + if _item: + _items.append(_item.to_dict()) + _dict['instances'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListPrivateNetworkResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "privateNetworkId": obj.get("privateNetworkId"), + "dataCenter": obj.get("dataCenter"), + "region": obj.get("region"), + "regionName": obj.get("regionName"), + "name": obj.get("name"), + "description": obj.get("description"), + "cidr": obj.get("cidr"), + "availableIps": obj.get("availableIps"), + "createdDate": obj.get("createdDate"), + "instances": [Instances.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_role_audit_response.py b/pfruck_contabo/models/list_role_audit_response.py new file mode 100644 index 0000000..2a94eed --- /dev/null +++ b/pfruck_contabo/models/list_role_audit_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.role_audit_response import RoleAuditResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListRoleAuditResponse(BaseModel): + """ + ListRoleAuditResponse + """ # noqa: E501 + data: List[RoleAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 ListRoleAuditResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListRoleAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [RoleAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_role_response.py b/pfruck_contabo/models/list_role_response.py new file mode 100644 index 0000000..a06a01e --- /dev/null +++ b/pfruck_contabo/models/list_role_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.role_response import RoleResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListRoleResponse(BaseModel): + """ + ListRoleResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[RoleResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListRoleResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListRoleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [RoleResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_secret_audit_response.py b/pfruck_contabo/models/list_secret_audit_response.py new file mode 100644 index 0000000..bf68196 --- /dev/null +++ b/pfruck_contabo/models/list_secret_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.secret_audit_response import SecretAuditResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListSecretAuditResponse(BaseModel): + """ + ListSecretAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[SecretAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListSecretAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListSecretAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [SecretAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_secret_response.py b/pfruck_contabo/models/list_secret_response.py new file mode 100644 index 0000000..fa65941 --- /dev/null +++ b/pfruck_contabo/models/list_secret_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.secret_response import SecretResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class ListSecretResponse(BaseModel): + """ + ListSecretResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[SecretResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListSecretResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListSecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [SecretResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_snapshot_response.py b/pfruck_contabo/models/list_snapshot_response.py new file mode 100644 index 0000000..c2884ce --- /dev/null +++ b/pfruck_contabo/models/list_snapshot_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.snapshot_response import SnapshotResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListSnapshotResponse(BaseModel): + """ + ListSnapshotResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[SnapshotResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListSnapshotResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListSnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [SnapshotResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_snapshots_audit_response.py b/pfruck_contabo/models/list_snapshots_audit_response.py new file mode 100644 index 0000000..8961d3d --- /dev/null +++ b/pfruck_contabo/models/list_snapshots_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.snapshots_audit_response import SnapshotsAuditResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListSnapshotsAuditResponse(BaseModel): + """ + ListSnapshotsAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[SnapshotsAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListSnapshotsAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListSnapshotsAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [SnapshotsAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_tag_audits_response.py b/pfruck_contabo/models/list_tag_audits_response.py new file mode 100644 index 0000000..bc3ad18 --- /dev/null +++ b/pfruck_contabo/models/list_tag_audits_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.tag_audit_response import TagAuditResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListTagAuditsResponse(BaseModel): + """ + ListTagAuditsResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[TagAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListTagAuditsResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListTagAuditsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [TagAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_tag_response.py b/pfruck_contabo/models/list_tag_response.py new file mode 100644 index 0000000..326e671 --- /dev/null +++ b/pfruck_contabo/models/list_tag_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.tag_response import TagResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListTagResponse(BaseModel): + """ + ListTagResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[TagResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListTagResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListTagResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [TagResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_user_audit_response.py b/pfruck_contabo/models/list_user_audit_response.py new file mode 100644 index 0000000..690c51e --- /dev/null +++ b/pfruck_contabo/models/list_user_audit_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.user_audit_response import UserAuditResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListUserAuditResponse(BaseModel): + """ + ListUserAuditResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[UserAuditResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListUserAuditResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListUserAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [UserAuditResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/list_user_response.py b/pfruck_contabo/models/list_user_response.py new file mode 100644 index 0000000..99cd32b --- /dev/null +++ b/pfruck_contabo/models/list_user_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.links import Links +from pfruck_contabo.models.pagination_meta import PaginationMeta +from pfruck_contabo.models.user_response import UserResponse +from typing import Optional, Set +from typing_extensions import Self + +class ListUserResponse(BaseModel): + """ + ListUserResponse + """ # noqa: E501 + pagination: PaginationMeta = Field(description="Data about pagination like how many results, pages, page size.", alias="_pagination") + data: List[UserResponse] + links: Links = Field(alias="_links") + __properties: ClassVar[List[str]] = ["_pagination", "data", "_links"] + + 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 ListUserResponse 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 pagination + if self.pagination: + _dict['_pagination'] = self.pagination.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListUserResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_pagination": PaginationMeta.from_dict(obj["_pagination"]) if obj.get("_pagination") is not None else None, + "data": [UserResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": Links.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/minimum_requirements.py b/pfruck_contabo/models/minimum_requirements.py new file mode 100644 index 0000000..299d453 --- /dev/null +++ b/pfruck_contabo/models/minimum_requirements.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class MinimumRequirements(BaseModel): + """ + MinimumRequirements + """ # noqa: E501 + cpu_cores: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CPU Cores Requirement", alias="cpuCores") + ram_mb: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Memory Requirement in MB", alias="ramMb") + disk_mb: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Storage Requirement in MB", alias="diskMb") + __properties: ClassVar[List[str]] = ["cpuCores", "ramMb", "diskMb"] + + 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 MinimumRequirements 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 MinimumRequirements from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cpuCores": obj.get("cpuCores"), + "ramMb": obj.get("ramMb"), + "diskMb": obj.get("diskMb") + }) + return _obj + + diff --git a/pfruck_contabo/models/object_storage_audit_response.py b/pfruck_contabo/models/object_storage_audit_response.py new file mode 100644 index 0000000..f6c83e8 --- /dev/null +++ b/pfruck_contabo/models/object_storage_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, 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 ObjectStorageAuditResponse(BaseModel): + """ + ObjectStorageAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The identifier of the audit entry.") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer number", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User ID", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + object_storage_id: StrictStr = Field(description="Object Storage Id", alias="objectStorageId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "objectStorageId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 ObjectStorageAuditResponse 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 ObjectStorageAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "objectStorageId": obj.get("objectStorageId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/object_storage_response.py b/pfruck_contabo/models/object_storage_response.py new file mode 100644 index 0000000..22a3b06 --- /dev/null +++ b/pfruck_contabo/models/object_storage_response.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 date, datetime +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 pfruck_contabo.models.auto_scaling_type_response import AutoScalingTypeResponse +from typing import Optional, Set +from typing_extensions import Self + +class ObjectStorageResponse(BaseModel): + """ + ObjectStorageResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + object_storage_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your object storage id", alias="objectStorageId") + created_date: datetime = Field(description="Creation date for object storage.", alias="createdDate") + cancel_date: date = Field(description="Cancellation date for object storage.", alias="cancelDate") + auto_scaling: AutoScalingTypeResponse = Field(description="Autoscaling settings", alias="autoScaling") + data_center: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Data center your object storage is located", alias="dataCenter") + total_purchased_space_tb: Union[StrictFloat, StrictInt] = Field(description="Amount of purchased / requested object storage in TB.", alias="totalPurchasedSpaceTB") + s3_url: StrictStr = Field(description="S3 URL to connect to your S3 compatible object storage", alias="s3Url") + s3_tenant_id: StrictStr = Field(description="Your S3 tenantId. Only required for public sharing.", alias="s3TenantId") + status: StrictStr = Field(description="The object storage status") + region: StrictStr = Field(description="The region where your object storage is located") + display_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Display name for object storage.", alias="displayName") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "objectStorageId", "createdDate", "cancelDate", "autoScaling", "dataCenter", "totalPurchasedSpaceTB", "s3Url", "s3TenantId", "status", "region", "displayName"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['READY', 'PROVISIONING', 'UPGRADING', 'CANCELLED', 'ERROR', 'ENABLED', 'DISABLED', 'MANUAL_PROVISIONING', 'PRODUCT_NOT_AVAILABLE', 'LIMIT_EXCEEDED', 'VERIFICATION_REQUIRED', 'COMPLETED', 'ORDER_PROCESSING', 'PENDING_PAYMENT', 'UNKNOWN']): + raise ValueError("must be one of enum values ('READY', 'PROVISIONING', 'UPGRADING', 'CANCELLED', 'ERROR', 'ENABLED', 'DISABLED', 'MANUAL_PROVISIONING', 'PRODUCT_NOT_AVAILABLE', 'LIMIT_EXCEEDED', 'VERIFICATION_REQUIRED', 'COMPLETED', 'ORDER_PROCESSING', 'PENDING_PAYMENT', 'UNKNOWN')") + 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 ObjectStorageResponse 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 auto_scaling + if self.auto_scaling: + _dict['autoScaling'] = self.auto_scaling.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ObjectStorageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "objectStorageId": obj.get("objectStorageId"), + "createdDate": obj.get("createdDate"), + "cancelDate": obj.get("cancelDate"), + "autoScaling": AutoScalingTypeResponse.from_dict(obj["autoScaling"]) if obj.get("autoScaling") is not None else None, + "dataCenter": obj.get("dataCenter"), + "totalPurchasedSpaceTB": obj.get("totalPurchasedSpaceTB"), + "s3Url": obj.get("s3Url"), + "s3TenantId": obj.get("s3TenantId"), + "status": obj.get("status"), + "region": obj.get("region"), + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/pfruck_contabo/models/object_storages_stats_response.py b/pfruck_contabo/models/object_storages_stats_response.py new file mode 100644 index 0000000..156bc52 --- /dev/null +++ b/pfruck_contabo/models/object_storages_stats_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.object_storages_stats_response_data import ObjectStoragesStatsResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class ObjectStoragesStatsResponse(BaseModel): + """ + ObjectStoragesStatsResponse + """ # noqa: E501 + data: List[ObjectStoragesStatsResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 ObjectStoragesStatsResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ObjectStoragesStatsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ObjectStoragesStatsResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/object_storages_stats_response_data.py b/pfruck_contabo/models/object_storages_stats_response_data.py new file mode 100644 index 0000000..0a239fa --- /dev/null +++ b/pfruck_contabo/models/object_storages_stats_response_data.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ObjectStoragesStatsResponseData(BaseModel): + """ + ObjectStoragesStatsResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + used_space_tb: Union[StrictFloat, StrictInt] = Field(description="Currently used space in TB.", alias="usedSpaceTB") + used_space_percentage: Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(description="Currently used space in percentage.", alias="usedSpacePercentage") + number_of_objects: StrictInt = Field(description="Number of all objects (i.e. files and folders) in object storage.", alias="numberOfObjects") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "usedSpaceTB", "usedSpacePercentage", "numberOfObjects"] + + 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 ObjectStoragesStatsResponseData 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 ObjectStoragesStatsResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "usedSpaceTB": obj.get("usedSpaceTB"), + "usedSpacePercentage": obj.get("usedSpacePercentage"), + "numberOfObjects": obj.get("numberOfObjects") + }) + return _obj + + diff --git a/pfruck_contabo/models/optimal_requirements.py b/pfruck_contabo/models/optimal_requirements.py new file mode 100644 index 0000000..9bf42b6 --- /dev/null +++ b/pfruck_contabo/models/optimal_requirements.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class OptimalRequirements(BaseModel): + """ + OptimalRequirements + """ # noqa: E501 + cpu_cores: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CPU Cores Requirement", alias="cpuCores") + ram_mb: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Memory Requirement in MB", alias="ramMb") + disk_mb: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Storage Requirement in MB", alias="diskMb") + __properties: ClassVar[List[str]] = ["cpuCores", "ramMb", "diskMb"] + + 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 OptimalRequirements 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 OptimalRequirements from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cpuCores": obj.get("cpuCores"), + "ramMb": obj.get("ramMb"), + "diskMb": obj.get("diskMb") + }) + return _obj + + diff --git a/pfruck_contabo/models/pagination_meta.py b/pfruck_contabo/models/pagination_meta.py new file mode 100644 index 0000000..b3fa516 --- /dev/null +++ b/pfruck_contabo/models/pagination_meta.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class PaginationMeta(BaseModel): + """ + PaginationMeta + """ # noqa: E501 + size: Union[StrictFloat, StrictInt] = Field(description="Number of elements per page.") + total_elements: Union[StrictFloat, StrictInt] = Field(description="Number of overall matched elements.", alias="totalElements") + total_pages: Union[StrictFloat, StrictInt] = Field(description="Overall number of pages.", alias="totalPages") + page: Union[StrictFloat, StrictInt] = Field(description="Current number of page.") + __properties: ClassVar[List[str]] = ["size", "totalElements", "totalPages", "page"] + + 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 PaginationMeta 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 PaginationMeta from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "size": obj.get("size"), + "totalElements": obj.get("totalElements"), + "totalPages": obj.get("totalPages"), + "page": obj.get("page") + }) + return _obj + + diff --git a/pfruck_contabo/models/patch_instance_request.py b/pfruck_contabo/models/patch_instance_request.py new file mode 100644 index 0000000..daaea8c --- /dev/null +++ b/pfruck_contabo/models/patch_instance_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class PatchInstanceRequest(BaseModel): + """ + PatchInstanceRequest + """ # noqa: E501 + display_name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The display name of the instance", alias="displayName") + __properties: ClassVar[List[str]] = ["displayName"] + + 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 PatchInstanceRequest 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 PatchInstanceRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/pfruck_contabo/models/patch_instance_response.py b/pfruck_contabo/models/patch_instance_response.py new file mode 100644 index 0000000..87e7fdf --- /dev/null +++ b/pfruck_contabo/models/patch_instance_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.patch_instance_response_data import PatchInstanceResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class PatchInstanceResponse(BaseModel): + """ + PatchInstanceResponse + """ # noqa: E501 + data: List[PatchInstanceResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 PatchInstanceResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PatchInstanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [PatchInstanceResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/patch_instance_response_data.py b/pfruck_contabo/models/patch_instance_response_data.py new file mode 100644 index 0000000..eb48ff9 --- /dev/null +++ b/pfruck_contabo/models/patch_instance_response_data.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class PatchInstanceResponseData(BaseModel): + """ + PatchInstanceResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Instance's id", alias="instanceId") + created_date: datetime = Field(description="Creation date of the instance", alias="createdDate") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "createdDate"] + + 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 PatchInstanceResponseData 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 PatchInstanceResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "createdDate": obj.get("createdDate") + }) + return _obj + + diff --git a/pfruck_contabo/models/patch_object_storage_request.py b/pfruck_contabo/models/patch_object_storage_request.py new file mode 100644 index 0000000..4a9f365 --- /dev/null +++ b/pfruck_contabo/models/patch_object_storage_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class PatchObjectStorageRequest(BaseModel): + """ + PatchObjectStorageRequest + """ # noqa: E501 + display_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Display name helps to differentiate between object storages, especially if they are in the same region.", alias="displayName") + __properties: ClassVar[List[str]] = ["displayName"] + + 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 PatchObjectStorageRequest 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 PatchObjectStorageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/pfruck_contabo/models/patch_private_network_request.py b/pfruck_contabo/models/patch_private_network_request.py new file mode 100644 index 0000000..2372a08 --- /dev/null +++ b/pfruck_contabo/models/patch_private_network_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class PatchPrivateNetworkRequest(BaseModel): + """ + PatchPrivateNetworkRequest + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The name of the Private Network. It may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per Private Network.") + description: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The description of the Private Network. There is a limit of 255 characters per Private Network.") + __properties: ClassVar[List[str]] = ["name", "description"] + + 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 PatchPrivateNetworkRequest 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 PatchPrivateNetworkRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description") + }) + return _obj + + diff --git a/pfruck_contabo/models/patch_private_network_response.py b/pfruck_contabo/models/patch_private_network_response.py new file mode 100644 index 0000000..f260792 --- /dev/null +++ b/pfruck_contabo/models/patch_private_network_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.private_network_response import PrivateNetworkResponse +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class PatchPrivateNetworkResponse(BaseModel): + """ + PatchPrivateNetworkResponse + """ # noqa: E501 + data: List[PrivateNetworkResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 PatchPrivateNetworkResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PatchPrivateNetworkResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [PrivateNetworkResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/patch_vnc_request.py b/pfruck_contabo/models/patch_vnc_request.py new file mode 100644 index 0000000..01de2b1 --- /dev/null +++ b/pfruck_contabo/models/patch_vnc_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 PatchVncRequest(BaseModel): + """ + PatchVncRequest + """ # noqa: E501 + vnc_password: StrictStr = Field(description="Password for instance VNC", alias="vncPassword") + __properties: ClassVar[List[str]] = ["vncPassword"] + + 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 PatchVncRequest 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 PatchVncRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "vncPassword": obj.get("vncPassword") + }) + return _obj + + diff --git a/pfruck_contabo/models/permission_request.py b/pfruck_contabo/models/permission_request.py new file mode 100644 index 0000000..5ac9cdb --- /dev/null +++ b/pfruck_contabo/models/permission_request.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class PermissionRequest(BaseModel): + """ + PermissionRequest + """ # noqa: E501 + api_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the role. There is a limit of 255 characters per role.", alias="apiName") + actions: List[StrictStr] = Field(description="Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints.") + resources: Optional[List[StrictInt]] = Field(default=None, description="The IDs of tags. Only if those tags are assgined to a resource the user with that role will be able to access the resource.") + __properties: ClassVar[List[str]] = ["apiName", "actions", "resources"] + + @field_validator('actions') + def actions_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['CREATE', 'READ', 'UPDATE', 'DELETE']): + raise ValueError("each list item must be one of ('CREATE', 'READ', 'UPDATE', 'DELETE')") + 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 PermissionRequest 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 PermissionRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "apiName": obj.get("apiName"), + "actions": obj.get("actions"), + "resources": obj.get("resources") + }) + return _obj + + diff --git a/pfruck_contabo/models/permission_response.py b/pfruck_contabo/models/permission_response.py new file mode 100644 index 0000000..5167488 --- /dev/null +++ b/pfruck_contabo/models/permission_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.resource_permissions_response import ResourcePermissionsResponse +from typing import Optional, Set +from typing_extensions import Self + +class PermissionResponse(BaseModel): + """ + PermissionResponse + """ # noqa: E501 + api_name: StrictStr = Field(description="API endpoint. In order to get a list availbale api enpoints please refer to the GET api-permissions endpoint.", alias="apiName") + actions: List[StrictStr] = Field(description="Action allowed for the API endpoint. Basically `CREATE` corresponds to POST endpoints, `READ` to GET endpoints, `UPDATE` to PATCH / PUT endpoints and `DELETE` to DELETE endpoints.") + resources: Optional[List[ResourcePermissionsResponse]] = None + __properties: ClassVar[List[str]] = ["apiName", "actions", "resources"] + + @field_validator('actions') + def actions_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(['CREATE', 'READ', 'UPDATE', 'DELETE']): + raise ValueError("each list item must be one of ('CREATE', 'READ', 'UPDATE', 'DELETE')") + 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 PermissionResponse 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 resources (list) + _items = [] + if self.resources: + for _item in self.resources: + if _item: + _items.append(_item.to_dict()) + _dict['resources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PermissionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "apiName": obj.get("apiName"), + "actions": obj.get("actions"), + "resources": [ResourcePermissionsResponse.from_dict(_item) for _item in obj["resources"]] if obj.get("resources") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/private_ip_config.py b/pfruck_contabo/models/private_ip_config.py new file mode 100644 index 0000000..9073824 --- /dev/null +++ b/pfruck_contabo/models/private_ip_config.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.ip_v4 import IpV4 +from typing import Optional, Set +from typing_extensions import Self + +class PrivateIpConfig(BaseModel): + """ + PrivateIpConfig + """ # noqa: E501 + v4: List[IpV4] + __properties: ClassVar[List[str]] = ["v4"] + + 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 PrivateIpConfig 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 v4 (list) + _items = [] + if self.v4: + for _item in self.v4: + if _item: + _items.append(_item.to_dict()) + _dict['v4'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrivateIpConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "v4": [IpV4.from_dict(_item) for _item in obj["v4"]] if obj.get("v4") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/private_network_audit_response.py b/pfruck_contabo/models/private_network_audit_response.py new file mode 100644 index 0000000..21af5d7 --- /dev/null +++ b/pfruck_contabo/models/private_network_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class PrivateNetworkAuditResponse(BaseModel): + """ + PrivateNetworkAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The identifier of the audit entry.") + private_network_id: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The identifier of the Private Network", alias="privateNetworkId") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer number", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User id", alias="changedBy") + username: StrictStr = Field(description="User name which did the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "privateNetworkId", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'DELETED', 'UPDATED']): + raise ValueError("must be one of enum values ('CREATED', 'DELETED', 'UPDATED')") + 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 PrivateNetworkAuditResponse 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 PrivateNetworkAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "privateNetworkId": obj.get("privateNetworkId"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/private_network_response.py b/pfruck_contabo/models/private_network_response.py new file mode 100644 index 0000000..396ed30 --- /dev/null +++ b/pfruck_contabo/models/private_network_response.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from pfruck_contabo.models.instances import Instances +from typing import Optional, Set +from typing_extensions import Self + +class PrivateNetworkResponse(BaseModel): + """ + PrivateNetworkResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + private_network_id: StrictInt = Field(description="Private Network's id", alias="privateNetworkId") + data_center: StrictStr = Field(description="The data center where your Private Network is located", alias="dataCenter") + region: StrictStr = Field(description="The slug of the region where your Private Network is located") + region_name: StrictStr = Field(description="The region where your Private Network is located", alias="regionName") + name: StrictStr = Field(description="The name of the Private Network") + description: StrictStr = Field(description="The description of the Private Network") + cidr: StrictStr = Field(description="The cidr range of the Private Network") + available_ips: StrictInt = Field(description="The total available IPs of the Private Network", alias="availableIps") + created_date: datetime = Field(description="The creation date of the Private Network", alias="createdDate") + instances: List[Instances] + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "privateNetworkId", "dataCenter", "region", "regionName", "name", "description", "cidr", "availableIps", "createdDate", "instances"] + + 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 PrivateNetworkResponse 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 instances (list) + _items = [] + if self.instances: + for _item in self.instances: + if _item: + _items.append(_item.to_dict()) + _dict['instances'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrivateNetworkResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "privateNetworkId": obj.get("privateNetworkId"), + "dataCenter": obj.get("dataCenter"), + "region": obj.get("region"), + "regionName": obj.get("regionName"), + "name": obj.get("name"), + "description": obj.get("description"), + "cidr": obj.get("cidr"), + "availableIps": obj.get("availableIps"), + "createdDate": obj.get("createdDate"), + "instances": [Instances.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/reinstall_instance_request.py b/pfruck_contabo/models/reinstall_instance_request.py new file mode 100644 index 0000000..d829018 --- /dev/null +++ b/pfruck_contabo/models/reinstall_instance_request.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 ReinstallInstanceRequest(BaseModel): + """ + ReinstallInstanceRequest + """ # noqa: E501 + image_id: StrictStr = Field(description="ImageId to be used to setup the compute instance.", alias="imageId") + ssh_keys: Optional[List[StrictInt]] = Field(default=None, description="Array of `secretId`s of public SSH keys for logging into as `defaultUser` with administrator/root privileges. Applies to Linux/BSD systems. Please refer to Secrets Management API.", alias="sshKeys") + root_password: Optional[StrictInt] = Field(default=None, description="`secretId` of the password for the `defaultUser` with administrator/root privileges. For Linux/BSD please use SSH, for Windows RDP. Please refer to Secrets Management API.", alias="rootPassword") + user_data: Optional[StrictStr] = Field(default=None, description="[Cloud-Init](https://cloud-init.io/) Config in order to customize during start of compute instance.", alias="userData") + default_user: Optional[StrictStr] = Field(default='admin', description="Default user name created for login during (re-)installation with administrative privileges. Allowed values for Linux/BSD are `admin` (use sudo to apply administrative privileges like root) or `root`. Allowed values for Windows are `admin` (has administrative privileges like administrator) or `administrator`.", alias="defaultUser") + application_id: Optional[StrictStr] = Field(default=None, description="Application ID", alias="applicationId") + __properties: ClassVar[List[str]] = ["imageId", "sshKeys", "rootPassword", "userData", "defaultUser", "applicationId"] + + @field_validator('default_user') + def default_user_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['root', 'admin', 'administrator']): + raise ValueError("must be one of enum values ('root', 'admin', 'administrator')") + 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 ReinstallInstanceRequest 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 ReinstallInstanceRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "imageId": obj.get("imageId"), + "sshKeys": obj.get("sshKeys"), + "rootPassword": obj.get("rootPassword"), + "userData": obj.get("userData"), + "defaultUser": obj.get("defaultUser") if obj.get("defaultUser") is not None else 'admin', + "applicationId": obj.get("applicationId") + }) + return _obj + + diff --git a/pfruck_contabo/models/reinstall_instance_response.py b/pfruck_contabo/models/reinstall_instance_response.py new file mode 100644 index 0000000..6c80722 --- /dev/null +++ b/pfruck_contabo/models/reinstall_instance_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.reinstall_instance_response_data import ReinstallInstanceResponseData +from pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class ReinstallInstanceResponse(BaseModel): + """ + ReinstallInstanceResponse + """ # noqa: E501 + data: List[ReinstallInstanceResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 ReinstallInstanceResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReinstallInstanceResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ReinstallInstanceResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/reinstall_instance_response_data.py b/pfruck_contabo/models/reinstall_instance_response_data.py new file mode 100644 index 0000000..d6f8dee --- /dev/null +++ b/pfruck_contabo/models/reinstall_instance_response_data.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ReinstallInstanceResponseData(BaseModel): + """ + ReinstallInstanceResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + instance_id: StrictInt = Field(description="Instance's id", alias="instanceId") + created_date: datetime = Field(description="Creation date for instance", alias="createdDate") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "createdDate"] + + 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 ReinstallInstanceResponseData 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 ReinstallInstanceResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "createdDate": obj.get("createdDate") + }) + return _obj + + diff --git a/pfruck_contabo/models/resource_permissions_response.py b/pfruck_contabo/models/resource_permissions_response.py new file mode 100644 index 0000000..126e39b --- /dev/null +++ b/pfruck_contabo/models/resource_permissions_response.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class ResourcePermissionsResponse(BaseModel): + """ + ResourcePermissionsResponse + """ # noqa: E501 + tag_id: StrictInt = Field(description="Tag's id", alias="tagId") + tag_name: StrictStr = Field(description="Tag name. The resriction is based on the resources which have been assigned to that tag. If no resource has been assigned to the given tag, no access will be possible.", alias="tagName") + __properties: ClassVar[List[str]] = ["tagId", "tagName"] + + 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 ResourcePermissionsResponse 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 ResourcePermissionsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tagId": obj.get("tagId"), + "tagName": obj.get("tagName") + }) + return _obj + + diff --git a/pfruck_contabo/models/role_audit_response.py b/pfruck_contabo/models/role_audit_response.py new file mode 100644 index 0000000..0628205 --- /dev/null +++ b/pfruck_contabo/models/role_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class RoleAuditResponse(BaseModel): + """ + RoleAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The identifier of the audit entry.") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer number", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User ID", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + role_id: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="The identifier of the role", alias="roleId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "roleId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 RoleAuditResponse 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 RoleAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "roleId": obj.get("roleId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/role_response.py b/pfruck_contabo/models/role_response.py new file mode 100644 index 0000000..4a08968 --- /dev/null +++ b/pfruck_contabo/models/role_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.permission_response import PermissionResponse +from typing import Optional, Set +from typing_extensions import Self + +class RoleResponse(BaseModel): + """ + RoleResponse + """ # noqa: E501 + role_id: StrictInt = Field(description="Role's id", alias="roleId") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + name: StrictStr = Field(description="Role's name") + admin: StrictBool = Field(description="Admin") + access_all_resources: StrictBool = Field(description="Access All Resources", alias="accessAllResources") + type: StrictStr = Field(description="Role type can be either `default` or `custom`. The `default` roles cannot be modified or deleted.") + permissions: Optional[List[PermissionResponse]] = None + __properties: ClassVar[List[str]] = ["roleId", "tenantId", "customerId", "name", "admin", "accessAllResources", "type", "permissions"] + + 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 RoleResponse 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 permissions (list) + _items = [] + if self.permissions: + for _item in self.permissions: + if _item: + _items.append(_item.to_dict()) + _dict['permissions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RoleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "roleId": obj.get("roleId"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "name": obj.get("name"), + "admin": obj.get("admin"), + "accessAllResources": obj.get("accessAllResources"), + "type": obj.get("type"), + "permissions": [PermissionResponse.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/rollback_snapshot_response.py b/pfruck_contabo/models/rollback_snapshot_response.py new file mode 100644 index 0000000..d60f486 --- /dev/null +++ b/pfruck_contabo/models/rollback_snapshot_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class RollbackSnapshotResponse(BaseModel): + """ + RollbackSnapshotResponse + """ # noqa: E501 + links: SelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 RollbackSnapshotResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RollbackSnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/secret_audit_response.py b/pfruck_contabo/models/secret_audit_response.py new file mode 100644 index 0000000..3aa35ef --- /dev/null +++ b/pfruck_contabo/models/secret_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SecretAuditResponse(BaseModel): + """ + SecretAuditResponse + """ # noqa: E501 + id: Union[StrictFloat, StrictInt] = Field(description="The identifier of the audit entry.") + secret_id: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="Secret's id", alias="secretId") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer number", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User ID", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "secretId", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 SecretAuditResponse 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 SecretAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "secretId": obj.get("secretId"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/secret_response.py b/pfruck_contabo/models/secret_response.py new file mode 100644 index 0000000..4adc014 --- /dev/null +++ b/pfruck_contabo/models/secret_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SecretResponse(BaseModel): + """ + SecretResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your Customer number", alias="customerId") + secret_id: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="Secret's id", alias="secretId") + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name assigned to the password/ssh") + type: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field(description="The type of the secret. This will be available only when retrieving secrets") + value: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field(description="The value of the secret. This will be available only when retrieving a single secret") + created_at: datetime = Field(description="The creation date for the secret", alias="createdAt") + updated_at: datetime = Field(description="The last update date for the secret", alias="updatedAt") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "secretId", "name", "type", "value", "createdAt", "updatedAt"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['password', 'ssh']): + raise ValueError("must be one of enum values ('password', 'ssh')") + 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 SecretResponse 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 SecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "secretId": obj.get("secretId"), + "name": obj.get("name"), + "type": obj.get("type"), + "value": obj.get("value"), + "createdAt": obj.get("createdAt"), + "updatedAt": obj.get("updatedAt") + }) + return _obj + + diff --git a/pfruck_contabo/models/self_links.py b/pfruck_contabo/models/self_links.py new file mode 100644 index 0000000..6b486c7 --- /dev/null +++ b/pfruck_contabo/models/self_links.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 SelfLinks(BaseModel): + """ + SelfLinks + """ # noqa: E501 + var_self: StrictStr = Field(description="Link to current resource.", alias="self") + __properties: ClassVar[List[str]] = ["self"] + + 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 SelfLinks 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 SelfLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": obj.get("self") + }) + return _obj + + diff --git a/pfruck_contabo/models/snapshot_response.py b/pfruck_contabo/models/snapshot_response.py new file mode 100644 index 0000000..1e5ed7d --- /dev/null +++ b/pfruck_contabo/models/snapshot_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class SnapshotResponse(BaseModel): + """ + SnapshotResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + snapshot_id: StrictStr = Field(description="Snapshot's id", alias="snapshotId") + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the snapshot.") + description: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The description of the snapshot.") + instance_id: StrictInt = Field(description="The instance identifier associated with the snapshot", alias="instanceId") + created_date: datetime = Field(description="The date when the snapshot was created", alias="createdDate") + auto_delete_date: datetime = Field(description="The date when the snapshot will be auto-deleted", alias="autoDeleteDate") + image_id: StrictStr = Field(description="Image Id the snapshot was taken on", alias="imageId") + image_name: StrictStr = Field(description="Image name the snapshot was taken on", alias="imageName") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "snapshotId", "name", "description", "instanceId", "createdDate", "autoDeleteDate", "imageId", "imageName"] + + 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 SnapshotResponse 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 SnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "snapshotId": obj.get("snapshotId"), + "name": obj.get("name"), + "description": obj.get("description"), + "instanceId": obj.get("instanceId"), + "createdDate": obj.get("createdDate"), + "autoDeleteDate": obj.get("autoDeleteDate"), + "imageId": obj.get("imageId"), + "imageName": obj.get("imageName") + }) + return _obj + + diff --git a/pfruck_contabo/models/snapshots_audit_response.py b/pfruck_contabo/models/snapshots_audit_response.py new file mode 100644 index 0000000..13876df --- /dev/null +++ b/pfruck_contabo/models/snapshots_audit_response.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, 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 SnapshotsAuditResponse(BaseModel): + """ + SnapshotsAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The ID of the audit entry.") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Id of user who performed the change", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + instance_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The identifier of the instance", alias="instanceId") + snapshot_id: StrictStr = Field(description="The identifier of the snapshot", alias="snapshotId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes") + __properties: ClassVar[List[str]] = ["id", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "instanceId", "snapshotId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 SnapshotsAuditResponse 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 SnapshotsAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "instanceId": obj.get("instanceId"), + "snapshotId": obj.get("snapshotId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/tag_assignment_self_links.py b/pfruck_contabo/models/tag_assignment_self_links.py new file mode 100644 index 0000000..c7f01f8 --- /dev/null +++ b/pfruck_contabo/models/tag_assignment_self_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 TagAssignmentSelfLinks(BaseModel): + """ + TagAssignmentSelfLinks + """ # noqa: E501 + var_self: StrictStr = Field(description="Link to current resource.", alias="self") + tag: StrictStr = Field(description="Link to related tag.") + resource: StrictStr = Field(description="Link to assigned resource", alias="_resource") + __properties: ClassVar[List[str]] = ["self", "tag", "_resource"] + + 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 TagAssignmentSelfLinks 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 TagAssignmentSelfLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": obj.get("self"), + "tag": obj.get("tag"), + "_resource": obj.get("_resource") + }) + return _obj + + diff --git a/pfruck_contabo/models/tag_audit_response.py b/pfruck_contabo/models/tag_audit_response.py new file mode 100644 index 0000000..6d2bc23 --- /dev/null +++ b/pfruck_contabo/models/tag_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class TagAuditResponse(BaseModel): + """ + TagAuditResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + id: Union[StrictFloat, StrictInt] = Field(description="The identifier of the audit entry.") + tag_id: Annotated[int, Field(strict=True, ge=0)] = Field(description="The identifier of the audit entry.", alias="tagId") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User ID", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "id", "tagId", "action", "timestamp", "changedBy", "username", "requestId", "traceId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'DELETED', 'UPDATED']): + raise ValueError("must be one of enum values ('CREATED', 'DELETED', 'UPDATED')") + 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 TagAuditResponse 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 TagAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "id": obj.get("id"), + "tagId": obj.get("tagId"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/tag_response.py b/pfruck_contabo/models/tag_response.py new file mode 100644 index 0000000..a37485c --- /dev/null +++ b/pfruck_contabo/models/tag_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class TagResponse(BaseModel): + """ + TagResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + tag_id: StrictInt = Field(description="Tag's id", alias="tagId") + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Tag's name") + color: Annotated[str, Field(min_length=4, strict=True, max_length=7)] = Field(description="Tag's color") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "tagId", "name", "color"] + + 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 TagResponse 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 TagResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "tagId": obj.get("tagId"), + "name": obj.get("name"), + "color": obj.get("color") + }) + return _obj + + diff --git a/pfruck_contabo/models/unassign_instance_private_network_response.py b/pfruck_contabo/models/unassign_instance_private_network_response.py new file mode 100644 index 0000000..791b2f2 --- /dev/null +++ b/pfruck_contabo/models/unassign_instance_private_network_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.instance_assignment_self_links import InstanceAssignmentSelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class UnassignInstancePrivateNetworkResponse(BaseModel): + """ + UnassignInstancePrivateNetworkResponse + """ # noqa: E501 + links: InstanceAssignmentSelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 UnassignInstancePrivateNetworkResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnassignInstancePrivateNetworkResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": InstanceAssignmentSelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_custom_image_request.py b/pfruck_contabo/models/update_custom_image_request.py new file mode 100644 index 0000000..1df655e --- /dev/null +++ b/pfruck_contabo/models/update_custom_image_request.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 UpdateCustomImageRequest(BaseModel): + """ + UpdateCustomImageRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Image Name") + description: Optional[StrictStr] = Field(default=None, description="Image Description") + __properties: ClassVar[List[str]] = ["name", "description"] + + 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 UpdateCustomImageRequest 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 UpdateCustomImageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description") + }) + return _obj + + diff --git a/pfruck_contabo/models/update_custom_image_response.py b/pfruck_contabo/models/update_custom_image_response.py new file mode 100644 index 0000000..3bf9e35 --- /dev/null +++ b/pfruck_contabo/models/update_custom_image_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.update_custom_image_response_data import UpdateCustomImageResponseData +from typing import Optional, Set +from typing_extensions import Self + +class UpdateCustomImageResponse(BaseModel): + """ + UpdateCustomImageResponse + """ # noqa: E501 + data: List[UpdateCustomImageResponseData] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 UpdateCustomImageResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateCustomImageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [UpdateCustomImageResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_custom_image_response_data.py b/pfruck_contabo/models/update_custom_image_response_data.py new file mode 100644 index 0000000..147a639 --- /dev/null +++ b/pfruck_contabo/models/update_custom_image_response_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UpdateCustomImageResponseData(BaseModel): + """ + UpdateCustomImageResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + image_id: StrictStr = Field(description="Image's id", alias="imageId") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "imageId"] + + 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 UpdateCustomImageResponseData 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 UpdateCustomImageResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "imageId": obj.get("imageId") + }) + return _obj + + diff --git a/pfruck_contabo/models/update_role_request.py b/pfruck_contabo/models/update_role_request.py new file mode 100644 index 0000000..8b75f91 --- /dev/null +++ b/pfruck_contabo/models/update_role_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from pfruck_contabo.models.permission_request import PermissionRequest +from typing import Optional, Set +from typing_extensions import Self + +class UpdateRoleRequest(BaseModel): + """ + UpdateRoleRequest + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The name of the role. There is a limit of 255 characters per role.") + admin: StrictBool = Field(description="If user is admin he will have permissions to all API endpoints and resources. Enabling this will superseed all role definitions and `accessAllResources`.") + access_all_resources: StrictBool = Field(description="Allow access to all resources. This will superseed all assigned resources in a role.", alias="accessAllResources") + permissions: Optional[List[PermissionRequest]] = None + __properties: ClassVar[List[str]] = ["name", "admin", "accessAllResources", "permissions"] + + 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 UpdateRoleRequest 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 permissions (list) + _items = [] + if self.permissions: + for _item in self.permissions: + if _item: + _items.append(_item.to_dict()) + _dict['permissions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateRoleRequest 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"), + "admin": obj.get("admin"), + "accessAllResources": obj.get("accessAllResources"), + "permissions": [PermissionRequest.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_role_response.py b/pfruck_contabo/models/update_role_response.py new file mode 100644 index 0000000..312b3ce --- /dev/null +++ b/pfruck_contabo/models/update_role_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class UpdateRoleResponse(BaseModel): + """ + UpdateRoleResponse + """ # noqa: E501 + links: SelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 UpdateRoleResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateRoleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_secret_request.py b/pfruck_contabo/models/update_secret_request.py new file mode 100644 index 0000000..971cb4e --- /dev/null +++ b/pfruck_contabo/models/update_secret_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class UpdateSecretRequest(BaseModel): + """ + UpdateSecretRequest + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the secret to be saved") + value: Optional[Annotated[str, Field(min_length=8, strict=True)]] = Field(default=None, description="The value of the secret to be saved") + __properties: ClassVar[List[str]] = ["name", "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 UpdateSecretRequest 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 UpdateSecretRequest 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"), + "value": obj.get("value") + }) + return _obj + + diff --git a/pfruck_contabo/models/update_secret_response.py b/pfruck_contabo/models/update_secret_response.py new file mode 100644 index 0000000..dab9596 --- /dev/null +++ b/pfruck_contabo/models/update_secret_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class UpdateSecretResponse(BaseModel): + """ + UpdateSecretResponse + """ # noqa: E501 + links: SelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 UpdateSecretResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateSecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_snapshot_request.py b/pfruck_contabo/models/update_snapshot_request.py new file mode 100644 index 0000000..0d3e53b --- /dev/null +++ b/pfruck_contabo/models/update_snapshot_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class UpdateSnapshotRequest(BaseModel): + """ + UpdateSnapshotRequest + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The name of the snapshot. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per snapshot.") + description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The description of the snapshot. There is a limit of 255 characters per snapshot.") + __properties: ClassVar[List[str]] = ["name", "description"] + + 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 UpdateSnapshotRequest 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 UpdateSnapshotRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description") + }) + return _obj + + diff --git a/pfruck_contabo/models/update_snapshot_response.py b/pfruck_contabo/models/update_snapshot_response.py new file mode 100644 index 0000000..9de684c --- /dev/null +++ b/pfruck_contabo/models/update_snapshot_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.snapshot_response import SnapshotResponse +from typing import Optional, Set +from typing_extensions import Self + +class UpdateSnapshotResponse(BaseModel): + """ + UpdateSnapshotResponse + """ # noqa: E501 + data: List[SnapshotResponse] + links: SelfLinks = Field(alias="_links") + __properties: ClassVar[List[str]] = ["data", "_links"] + + 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 UpdateSnapshotResponse 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 data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateSnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [SnapshotResponse.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_tag_request.py b/pfruck_contabo/models/update_tag_request.py new file mode 100644 index 0000000..49e4efc --- /dev/null +++ b/pfruck_contabo/models/update_tag_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 typing import Optional, Set +from typing_extensions import Self + +class UpdateTagRequest(BaseModel): + """ + UpdateTagRequest + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The name of the tag. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag.") + color: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=7)]] = Field(default=None, description="The color of the tag. Color can be specified using hexadecimal value. Default color is #0A78C3") + __properties: ClassVar[List[str]] = ["name", "color"] + + 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 UpdateTagRequest 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 UpdateTagRequest 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"), + "color": obj.get("color") + }) + return _obj + + diff --git a/pfruck_contabo/models/update_tag_response.py b/pfruck_contabo/models/update_tag_response.py new file mode 100644 index 0000000..a00d7f1 --- /dev/null +++ b/pfruck_contabo/models/update_tag_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class UpdateTagResponse(BaseModel): + """ + UpdateTagResponse + """ # noqa: E501 + links: SelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 UpdateTagResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateTagResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/update_user_request.py b/pfruck_contabo/models/update_user_request.py new file mode 100644 index 0000000..39b39da --- /dev/null +++ b/pfruck_contabo/models/update_user_request.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool, StrictInt, 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 UpdateUserRequest(BaseModel): + """ + UpdateUserRequest + """ # noqa: E501 + first_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The name of the user. Names may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user.", alias="firstName") + last_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The last name of the user. Users may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user.", alias="lastName") + email: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = Field(default=None, description="The email of the user to which activation and forgot password links are being sent to. There is a limit of 255 characters per email.") + enabled: Optional[StrictBool] = Field(default=None, description="If user is not enabled, he can't login and thus use services any longer.") + totp: Optional[StrictBool] = Field(default=None, description="Enable or disable two-factor authentication (2FA) via time based OTP.") + locale: Optional[StrictStr] = Field(default=None, description="The locale of the user. This can be `de-DE`, `de`, `en-US`, `en`") + roles: Optional[List[StrictInt]] = Field(default=None, description="The roles as list of `roleId`s of the user.") + __properties: ClassVar[List[str]] = ["firstName", "lastName", "email", "enabled", "totp", "locale", "roles"] + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['de-DE', 'de', 'en-US', 'en']): + raise ValueError("must be one of enum values ('de-DE', 'de', 'en-US', 'en')") + 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 UpdateUserRequest 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 UpdateUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "firstName": obj.get("firstName"), + "lastName": obj.get("lastName"), + "email": obj.get("email"), + "enabled": obj.get("enabled"), + "totp": obj.get("totp"), + "locale": obj.get("locale"), + "roles": obj.get("roles") + }) + return _obj + + diff --git a/pfruck_contabo/models/update_user_response.py b/pfruck_contabo/models/update_user_response.py new file mode 100644 index 0000000..f6dd899 --- /dev/null +++ b/pfruck_contabo/models/update_user_response.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class UpdateUserResponse(BaseModel): + """ + UpdateUserResponse + """ # noqa: E501 + links: SelfLinks = Field(description="Links for easy navigation.", alias="_links") + __properties: ClassVar[List[str]] = ["_links"] + + 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 UpdateUserResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateUserResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/upgrade_auto_scaling_type.py b/pfruck_contabo/models/upgrade_auto_scaling_type.py new file mode 100644 index 0000000..7c465e5 --- /dev/null +++ b/pfruck_contabo/models/upgrade_auto_scaling_type.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class UpgradeAutoScalingType(BaseModel): + """ + UpgradeAutoScalingType + """ # noqa: E501 + state: Optional[StrictStr] = Field(default=None, description="State of the autoscaling for the current object storage.") + size_limit_tb: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Autoscaling size limit for the current object storage.", alias="sizeLimitTB") + __properties: ClassVar[List[str]] = ["state", "sizeLimitTB"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['enabled', 'disabled']): + raise ValueError("must be one of enum values ('enabled', 'disabled')") + 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 UpgradeAutoScalingType 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 UpgradeAutoScalingType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "state": obj.get("state"), + "sizeLimitTB": obj.get("sizeLimitTB") + }) + return _obj + + diff --git a/pfruck_contabo/models/upgrade_instance_request.py b/pfruck_contabo/models/upgrade_instance_request.py new file mode 100644 index 0000000..b6b874c --- /dev/null +++ b/pfruck_contabo/models/upgrade_instance_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 import Optional, Set +from typing_extensions import Self + +class UpgradeInstanceRequest(BaseModel): + """ + UpgradeInstanceRequest + """ # noqa: E501 + private_networking: Optional[Dict[str, Any]] = Field(default=None, description="Set this attribute if you want to upgrade your instance with the Private Networking addon. Please provide an empty object for the time being as value. There will be more configuration possible in the future.", alias="privateNetworking") + __properties: ClassVar[List[str]] = ["privateNetworking"] + + 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 UpgradeInstanceRequest 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 UpgradeInstanceRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "privateNetworking": obj.get("privateNetworking") + }) + return _obj + + diff --git a/pfruck_contabo/models/upgrade_object_storage_request.py b/pfruck_contabo/models/upgrade_object_storage_request.py new file mode 100644 index 0000000..9a3a830 --- /dev/null +++ b/pfruck_contabo/models/upgrade_object_storage_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 +from typing import Any, ClassVar, Dict, List, Optional, Union +from pfruck_contabo.models.upgrade_auto_scaling_type import UpgradeAutoScalingType +from typing import Optional, Set +from typing_extensions import Self + +class UpgradeObjectStorageRequest(BaseModel): + """ + UpgradeObjectStorageRequest + """ # noqa: E501 + auto_scaling: Optional[UpgradeAutoScalingType] = Field(default=None, description="New monthly object storage size limit for autoscaling if enabled.", alias="autoScaling") + total_purchased_space_tb: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="New total object storage limit. If this number is larger than before you will also be billed for the added storage space. No downgrade possible.", alias="totalPurchasedSpaceTB") + __properties: ClassVar[List[str]] = ["autoScaling", "totalPurchasedSpaceTB"] + + 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 UpgradeObjectStorageRequest 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 auto_scaling + if self.auto_scaling: + _dict['autoScaling'] = self.auto_scaling.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpgradeObjectStorageRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "autoScaling": UpgradeAutoScalingType.from_dict(obj["autoScaling"]) if obj.get("autoScaling") is not None else None, + "totalPurchasedSpaceTB": obj.get("totalPurchasedSpaceTB") + }) + return _obj + + diff --git a/pfruck_contabo/models/upgrade_object_storage_response.py b/pfruck_contabo/models/upgrade_object_storage_response.py new file mode 100644 index 0000000..a7ab937 --- /dev/null +++ b/pfruck_contabo/models/upgrade_object_storage_response.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.self_links import SelfLinks +from pfruck_contabo.models.upgrade_object_storage_response_data import UpgradeObjectStorageResponseData +from typing import Optional, Set +from typing_extensions import Self + +class UpgradeObjectStorageResponse(BaseModel): + """ + UpgradeObjectStorageResponse + """ # noqa: E501 + links: SelfLinks = Field(alias="_links") + data: List[UpgradeObjectStorageResponseData] + __properties: ClassVar[List[str]] = ["_links", "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 UpgradeObjectStorageResponse 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 links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpgradeObjectStorageResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "data": [UpgradeObjectStorageResponseData.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/pfruck_contabo/models/upgrade_object_storage_response_data.py b/pfruck_contabo/models/upgrade_object_storage_response_data.py new file mode 100644 index 0000000..801a7a5 --- /dev/null +++ b/pfruck_contabo/models/upgrade_object_storage_response_data.py @@ -0,0 +1,119 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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 pfruck_contabo.models.auto_scaling_type_response import AutoScalingTypeResponse +from typing import Optional, Set +from typing_extensions import Self + +class UpgradeObjectStorageResponseData(BaseModel): + """ + UpgradeObjectStorageResponseData + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + object_storage_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Object storage id", alias="objectStorageId") + created_date: StrictStr = Field(description="Creation date for object storage.", alias="createdDate") + data_center: StrictStr = Field(description="Data center of the object storage.", alias="dataCenter") + auto_scaling: AutoScalingTypeResponse = Field(description="The autoscaling limit of the object storage.", alias="autoScaling") + s3_url: StrictStr = Field(description="S3 URL to connect to your S3 compatible object storage", alias="s3Url") + status: StrictStr = Field(description="The object storage status") + total_purchased_space_tb: Union[StrictFloat, StrictInt] = Field(description="Total purchased object storage space in TB.", alias="totalPurchasedSpaceTB") + region: StrictStr = Field(description="The region where your object storage is located") + display_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="Display name for object storage.", alias="displayName") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "objectStorageId", "createdDate", "dataCenter", "autoScaling", "s3Url", "status", "totalPurchasedSpaceTB", "region", "displayName"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['READY', 'PROVISIONING', 'UPGRADING', 'CANCELLED', 'ERROR', 'ENABLED', 'DISABLED', 'MANUAL_PROVISIONING', 'PRODUCT_NOT_AVAILABLE', 'LIMIT_EXCEEDED', 'VERIFICATION_REQUIRED', 'COMPLETED', 'ORDER_PROCESSING', 'PENDING_PAYMENT', 'UNKNOWN']): + raise ValueError("must be one of enum values ('READY', 'PROVISIONING', 'UPGRADING', 'CANCELLED', 'ERROR', 'ENABLED', 'DISABLED', 'MANUAL_PROVISIONING', 'PRODUCT_NOT_AVAILABLE', 'LIMIT_EXCEEDED', 'VERIFICATION_REQUIRED', 'COMPLETED', 'ORDER_PROCESSING', 'PENDING_PAYMENT', 'UNKNOWN')") + 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 UpgradeObjectStorageResponseData 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 auto_scaling + if self.auto_scaling: + _dict['autoScaling'] = self.auto_scaling.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpgradeObjectStorageResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "objectStorageId": obj.get("objectStorageId"), + "createdDate": obj.get("createdDate"), + "dataCenter": obj.get("dataCenter"), + "autoScaling": AutoScalingTypeResponse.from_dict(obj["autoScaling"]) if obj.get("autoScaling") is not None else None, + "s3Url": obj.get("s3Url"), + "status": obj.get("status"), + "totalPurchasedSpaceTB": obj.get("totalPurchasedSpaceTB"), + "region": obj.get("region"), + "displayName": obj.get("displayName") + }) + return _obj + + diff --git a/pfruck_contabo/models/user_audit_response.py b/pfruck_contabo/models/user_audit_response.py new file mode 100644 index 0000000..5e2b546 --- /dev/null +++ b/pfruck_contabo/models/user_audit_response.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, 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 UserAuditResponse(BaseModel): + """ + UserAuditResponse + """ # noqa: E501 + id: StrictInt = Field(description="The identifier of the audit entry.") + action: StrictStr = Field(description="Type of the action.") + timestamp: datetime = Field(description="When the change took place.") + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer number", alias="customerId") + changed_by: Annotated[str, Field(min_length=1, strict=True)] = Field(description="User ID", alias="changedBy") + username: StrictStr = Field(description="Name of the user which led to the change.") + request_id: StrictStr = Field(description="The requestId of the API call which led to the change.", alias="requestId") + trace_id: StrictStr = Field(description="The traceId of the API call which led to the change.", alias="traceId") + user_id: StrictStr = Field(description="The identifier of the user", alias="userId") + changes: Optional[Dict[str, Any]] = Field(default=None, description="List of actual changes.") + __properties: ClassVar[List[str]] = ["id", "action", "timestamp", "tenantId", "customerId", "changedBy", "username", "requestId", "traceId", "userId", "changes"] + + @field_validator('action') + def action_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['CREATED', 'UPDATED', 'DELETED']): + raise ValueError("must be one of enum values ('CREATED', 'UPDATED', 'DELETED')") + 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 UserAuditResponse 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 UserAuditResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "action": obj.get("action"), + "timestamp": obj.get("timestamp"), + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "changedBy": obj.get("changedBy"), + "username": obj.get("username"), + "requestId": obj.get("requestId"), + "traceId": obj.get("traceId"), + "userId": obj.get("userId"), + "changes": obj.get("changes") + }) + return _obj + + diff --git a/pfruck_contabo/models/user_is_password_set_response.py b/pfruck_contabo/models/user_is_password_set_response.py new file mode 100644 index 0000000..94691e5 --- /dev/null +++ b/pfruck_contabo/models/user_is_password_set_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class UserIsPasswordSetResponse(BaseModel): + """ + UserIsPasswordSetResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + is_password_set: StrictBool = Field(description="Indicates if the user has set a password for his account", alias="isPasswordSet") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "isPasswordSet"] + + 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 UserIsPasswordSetResponse 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 UserIsPasswordSetResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "isPasswordSet": obj.get("isPasswordSet") + }) + return _obj + + diff --git a/pfruck_contabo/models/user_response.py b/pfruck_contabo/models/user_response.py new file mode 100644 index 0000000..5e6f254 --- /dev/null +++ b/pfruck_contabo/models/user_response.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from pfruck_contabo.models.role_response import RoleResponse +from typing import Optional, Set +from typing_extensions import Self + +class UserResponse(BaseModel): + """ + UserResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer number", alias="customerId") + user_id: StrictStr = Field(description="The identifier of the user.", alias="userId") + first_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The first name of the user. Users may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user.", alias="firstName") + last_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The last name of the user. Users may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per user.", alias="lastName") + email: Annotated[str, Field(min_length=1, strict=True, max_length=255)] = Field(description="The email of the user to which activation and forgot password links are being sent to. There is a limit of 255 characters per email.") + email_verified: StrictBool = Field(description="User email verification status.", alias="emailVerified") + enabled: StrictBool = Field(description="If uses is not enabled, he can't login and thus use services any longer.") + totp: StrictBool = Field(description="Enable or disable two-factor authentication (2FA) via time based OTP.") + locale: StrictStr = Field(description="The locale of the user. This can be `de-DE`, `de`, `en-US`, `en`") + roles: List[RoleResponse] = Field(description="The roles as list of `roleId`s of the user.") + owner: StrictBool = Field(description="If user is owner he will have permissions to all API endpoints and resources. Enabling this will superseed all role definitions and `accessAllResources`.") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "userId", "firstName", "lastName", "email", "emailVerified", "enabled", "totp", "locale", "roles", "owner"] + + @field_validator('locale') + def locale_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['de-DE', 'de', 'en-US', 'en']): + raise ValueError("must be one of enum values ('de-DE', 'de', 'en-US', 'en')") + 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 UserResponse 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 roles (list) + _items = [] + if self.roles: + for _item in self.roles: + if _item: + _items.append(_item.to_dict()) + _dict['roles'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "userId": obj.get("userId"), + "firstName": obj.get("firstName"), + "lastName": obj.get("lastName"), + "email": obj.get("email"), + "emailVerified": obj.get("emailVerified"), + "enabled": obj.get("enabled"), + "totp": obj.get("totp"), + "locale": obj.get("locale"), + "roles": [RoleResponse.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None, + "owner": obj.get("owner") + }) + return _obj + + diff --git a/pfruck_contabo/models/vnc_response.py b/pfruck_contabo/models/vnc_response.py new file mode 100644 index 0000000..2fa982a --- /dev/null +++ b/pfruck_contabo/models/vnc_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + 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, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class VncResponse(BaseModel): + """ + VncResponse + """ # noqa: E501 + tenant_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Your customer tenant id", alias="tenantId") + customer_id: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Customer ID", alias="customerId") + instance_id: StrictInt = Field(description="Instance ID", alias="instanceId") + enabled: StrictBool = Field(description="VNC Status for the instance.") + vnc_ip: StrictStr = Field(description="VNC IP for the instance.", alias="vncIp") + vnc_port: Union[StrictFloat, StrictInt] = Field(description="VNC Port for the instance.", alias="vncPort") + __properties: ClassVar[List[str]] = ["tenantId", "customerId", "instanceId", "enabled", "vncIp", "vncPort"] + + @field_validator('tenant_id') + def tenant_id_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['DE', 'INT']): + raise ValueError("must be one of enum values ('DE', 'INT')") + 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 VncResponse 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 VncResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tenantId": obj.get("tenantId"), + "customerId": obj.get("customerId"), + "instanceId": obj.get("instanceId"), + "enabled": obj.get("enabled"), + "vncIp": obj.get("vncIp"), + "vncPort": obj.get("vncPort") + }) + return _obj + + diff --git a/pfruck_contabo/py.typed b/pfruck_contabo/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pfruck_contabo/rest.py b/pfruck_contabo/rest.py index 1a3922c..4a3991d 100644 --- a/pfruck_contabo/rest.py +++ b/pfruck_contabo/rest.py @@ -1,54 +1,68 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 import io import json -import logging import re import ssl -from urllib.parse import urlencode -from urllib.parse import urlparse -from urllib.request import proxy_bypass_environment + import urllib3 -import ipaddress -from pfruck_contabo.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from pfruck_contabo.exceptions import ApiException, ApiValueError +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) + +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): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + 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.urllib3_response.getheaders() + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + 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 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -57,71 +71,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + 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: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + 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: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager - if configuration.proxy and not should_bypass_proxies( - configuration.host, no_proxy=configuration.no_proxy or ''): - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + 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( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + 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 query_params: query parameters in the 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 _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :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'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -133,61 +155,83 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' - if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', - headers['Content-Type'], re.IGNORECASE)): + + # 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, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + 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, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + 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 + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -198,155 +242,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - -# end of class RESTClientObject - - -def is_ipv4(target): - """ Test if IPv4 address or not - """ - try: - chk = ipaddress.IPv4Address(target) - return True - except ipaddress.AddressValueError: - return False - - -def in_ipv4net(target, net): - """ Test if target belongs to given IPv4 network - """ - try: - nw = ipaddress.IPv4Network(net) - ip = ipaddress.IPv4Address(target) - if ip in nw: - return True - return False - except ipaddress.AddressValueError: - return False - except ipaddress.NetmaskValueError: - return False - - -def should_bypass_proxies(url, no_proxy=None): - """ Yet another requests.should_bypass_proxies - Test if proxies should not be used for a particular url. - """ - - parsed = urlparse(url) - - # special cases - if parsed.hostname in [None, '']: - return True - - # special cases - if no_proxy in [None, '']: - return False - if no_proxy == '*': - return True - - no_proxy = no_proxy.lower().replace(' ', ''); - entries = ( - host for host in no_proxy.split(',') if host - ) - - if is_ipv4(parsed.hostname): - for item in entries: - if in_ipv4net(parsed.hostname, item): - return True - return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) + return RESTResponse(r) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d26cf8a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[tool.poetry] +name = "pfruck_contabo" +version = "1.12.0" +description = "Contabo API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/p-fruck/python-contabo" +keywords = ["OpenAPI", "OpenAPI-Generator", "Contabo API"] +include = ["pfruck_contabo/py.typed"] + +[tool.poetry.dependencies] +python = "^3.7" + +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +pydantic = ">=2" +typing-extensions = ">=4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" +types-python-dateutil = ">=2.8.19.14" +mypy = "1.4.1" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "pfruck_contabo", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/requirements.txt b/requirements.txt index 96947f6..cc85509 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/setup.py b/setup.py index e43a6ae..958b7a9 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,33 @@ +# coding: utf-8 + """ Contabo API The version of the OpenAPI document: 1.0.0 Contact: support@contabo.com - Generated by: https://openapi-generator.tech -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 from setuptools import setup, find_packages # noqa: H301 -NAME = "pfruck_contabo" -VERSION = "1.12.0" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - +NAME = "pfruck_contabo" +VERSION = "1.12.0" +PYTHON_REQUIRES = ">=3.7" REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] setup( @@ -32,10 +38,10 @@ author_email="support@contabo.com", url="https://github.com/p-fruck/python-contabo", keywords=["OpenAPI", "OpenAPI-Generator", "Contabo API"], - python_requires=">=3.6", install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, + long_description_content_type='text/markdown', long_description="""\ # pfruck_contabo @@ -89,18 +95,10 @@ ```python -import time import pfruck_contabo +from pfruck_contabo.rest import ApiException from pprint import pprint -from pfruck_contabo.api import images_api -from pfruck_contabo.model.create_custom_image_fail_response import CreateCustomImageFailResponse -from pfruck_contabo.model.create_custom_image_request import CreateCustomImageRequest -from pfruck_contabo.model.create_custom_image_response import CreateCustomImageResponse -from pfruck_contabo.model.custom_images_stats_response import CustomImagesStatsResponse -from pfruck_contabo.model.find_image_response import FindImageResponse -from pfruck_contabo.model.list_image_response import ListImageResponse -from pfruck_contabo.model.update_custom_image_request import UpdateCustomImageRequest -from pfruck_contabo.model.update_custom_image_response import UpdateCustomImageResponse + # Defining the host is optional and defaults to https://api.contabo.com # See configuration.py for a list of all supported configuration parameters. configuration = pfruck_contabo.Configuration( @@ -114,30 +112,26 @@ # Configure Bearer authorization (JWT): bearer configuration = pfruck_contabo.Configuration( - access_token = 'YOUR_BEARER_TOKEN' + access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with pfruck_contabo.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = images_api.ImagesApi(api_client) - x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. - create_custom_image_request = CreateCustomImageRequest( - name="Ubuntu Custom Image", - description="This is an UNOFFICIAL Python API client for Contabo", - url="https://example.com/image.qcow2", - os_type="Linux", - version="20.04.2", - ) # CreateCustomImageRequest | - x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + api_instance = pfruck_contabo.ImagesApi(api_client) + x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + create_custom_image_request = pfruck_contabo.CreateCustomImageRequest() # CreateCustomImageRequest | + x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional) try: # Provide a custom image api_response = api_instance.create_custom_image(x_request_id, create_custom_image_request, x_trace_id=x_trace_id) + print("The response of ImagesApi->create_custom_image:\\n") pprint(api_response) - except pfruck_contabo.ApiException as e: + except ApiException as e: print("Exception when calling ImagesApi->create_custom_image: %s\\n" % e) + ``` ## Documentation for API Endpoints @@ -242,12 +236,8 @@ - [ApiPermissionsResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ApiPermissionsResponse.md) - [ApplicationConfig](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationConfig.md) - [ApplicationRequirements](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationRequirements.md) - - [ApplicationRequirementsMinimum](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationRequirementsMinimum.md) - - [ApplicationRequirementsOptimal](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationRequirementsOptimal.md) - [ApplicationResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationResponse.md) - - [ApplicationResponseRequirements](https://github.com/p-fruck/python-contabo/blob/main/docs/ApplicationResponseRequirements.md) - [AssignInstancePrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignInstancePrivateNetworkResponse.md) - - [AssignInstancePrivateNetworkResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignInstancePrivateNetworkResponseLinks.md) - [AssignedTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignedTagResponse.md) - [AssignmentAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignmentAuditResponse.md) - [AssignmentResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignmentResponse.md) @@ -260,63 +250,45 @@ - [ClientResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ClientResponse.md) - [ClientSecretResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ClientSecretResponse.md) - [CreateAssignmentResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateAssignmentResponse.md) - - [CreateAssignmentResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateAssignmentResponseLinks.md) - [CreateCustomImageFailResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateCustomImageFailResponse.md) - [CreateCustomImageRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateCustomImageRequest.md) - [CreateCustomImageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateCustomImageResponse.md) - [CreateCustomImageResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateCustomImageResponseData.md) - - [CreateCustomImageResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateCustomImageResponseLinks.md) - [CreateInstanceAddons](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateInstanceAddons.md) - - [CreateInstanceAddonsExtraStorage](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateInstanceAddonsExtraStorage.md) - [CreateInstanceRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateInstanceRequest.md) - - [CreateInstanceRequestAddOns](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateInstanceRequestAddOns.md) - [CreateInstanceResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateInstanceResponse.md) - [CreateInstanceResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateInstanceResponseData.md) - [CreateObjectStorageRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateObjectStorageRequest.md) - - [CreateObjectStorageRequestAutoScaling](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateObjectStorageRequestAutoScaling.md) - [CreateObjectStorageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateObjectStorageResponse.md) - [CreateObjectStorageResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateObjectStorageResponseData.md) - - [CreateObjectStorageResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateObjectStorageResponseLinks.md) - [CreatePrivateNetworkRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreatePrivateNetworkRequest.md) - [CreatePrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreatePrivateNetworkResponse.md) - - [CreatePrivateNetworkResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreatePrivateNetworkResponseLinks.md) - [CreateRoleRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateRoleRequest.md) - [CreateRoleResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateRoleResponse.md) - [CreateRoleResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateRoleResponseData.md) - - [CreateRoleResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateRoleResponseLinks.md) - [CreateSecretRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateSecretRequest.md) - [CreateSecretResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateSecretResponse.md) - - [CreateSecretResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateSecretResponseLinks.md) - [CreateSnapshotRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateSnapshotRequest.md) - [CreateSnapshotResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateSnapshotResponse.md) - - [CreateSnapshotResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateSnapshotResponseLinks.md) - [CreateTagRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTagRequest.md) - [CreateTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTagResponse.md) - [CreateTagResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTagResponseData.md) - - [CreateTagResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTagResponseLinks.md) - [CreateTicketRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTicketRequest.md) - [CreateTicketResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTicketResponse.md) - [CreateTicketResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTicketResponseData.md) - - [CreateTicketResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateTicketResponseLinks.md) - [CreateUserRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateUserRequest.md) - [CreateUserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateUserResponse.md) - [CreateUserResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateUserResponseData.md) - - [CreateUserResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CreateUserResponseLinks.md) - [CredentialData](https://github.com/p-fruck/python-contabo/blob/main/docs/CredentialData.md) - [CustomImagesStatsResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/CustomImagesStatsResponse.md) - [CustomImagesStatsResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/CustomImagesStatsResponseData.md) - - [CustomImagesStatsResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/CustomImagesStatsResponseLinks.md) - [DataCenterResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/DataCenterResponse.md) - [ExtraStorageRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/ExtraStorageRequest.md) - [FindAssignmentResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindAssignmentResponse.md) - - [FindAssignmentResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/FindAssignmentResponseLinks.md) - [FindClientResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindClientResponse.md) - - [FindClientResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/FindClientResponseLinks.md) - [FindCredentialResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindCredentialResponse.md) - - [FindCredentialResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/FindCredentialResponseLinks.md) - [FindImageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindImageResponse.md) - [FindInstanceResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindInstanceResponse.md) - - [FindInstanceResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/FindInstanceResponseLinks.md) - [FindObjectStorageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindObjectStorageResponse.md) - [FindPrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindPrivateNetworkResponse.md) - [FindRoleResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindRoleResponse.md) @@ -324,38 +296,28 @@ - [FindSnapshotResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindSnapshotResponse.md) - [FindTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindTagResponse.md) - [FindUserIsPasswordSetResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindUserIsPasswordSetResponse.md) - - [FindUserIsPasswordSetResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/FindUserIsPasswordSetResponseLinks.md) - [FindUserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindUserResponse.md) - [FindVncResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/FindVncResponse.md) - - [FindVncResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/FindVncResponseLinks.md) - [FirewallingUpgradeRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/FirewallingUpgradeRequest.md) - [GenerateClientSecretResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/GenerateClientSecretResponse.md) - - [GenerateClientSecretResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/GenerateClientSecretResponseLinks.md) - [ImageAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ImageAuditResponse.md) - [ImageAuditResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/ImageAuditResponseData.md) - - [ImageAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ImageAuditResponseLinks.md) - [ImageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ImageResponse.md) - [InstanceAssignmentSelfLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceAssignmentSelfLinks.md) - [InstanceRescueActionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceRescueActionResponse.md) - [InstanceRescueActionResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceRescueActionResponseData.md) - - [InstanceRescueActionResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceRescueActionResponseLinks.md) - [InstanceResetPasswordActionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceResetPasswordActionResponse.md) - [InstanceResetPasswordActionResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceResetPasswordActionResponseData.md) - - [InstanceResetPasswordActionResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceResetPasswordActionResponseLinks.md) - [InstanceResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceResponse.md) - [InstanceRestartActionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceRestartActionResponse.md) - [InstanceRestartActionResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceRestartActionResponseData.md) - - [InstanceRestartActionResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceRestartActionResponseLinks.md) - [InstanceShutdownActionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceShutdownActionResponse.md) - [InstanceShutdownActionResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceShutdownActionResponseData.md) - - [InstanceShutdownActionResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceShutdownActionResponseLinks.md) - [InstanceStartActionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceStartActionResponse.md) - [InstanceStartActionResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceStartActionResponseData.md) - - [InstanceStartActionResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceStartActionResponseLinks.md) - [InstanceStatus](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceStatus.md) - [InstanceStopActionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceStopActionResponse.md) - [InstanceStopActionResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceStopActionResponseData.md) - - [InstanceStopActionResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/InstanceStopActionResponseLinks.md) - [Instances](https://github.com/p-fruck/python-contabo/blob/main/docs/Instances.md) - [InstancesActionsAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/InstancesActionsAuditResponse.md) - [InstancesActionsRescueRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/InstancesActionsRescueRequest.md) @@ -366,70 +328,42 @@ - [IpV6](https://github.com/p-fruck/python-contabo/blob/main/docs/IpV6.md) - [Links](https://github.com/p-fruck/python-contabo/blob/main/docs/Links.md) - [ListApiPermissionResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListApiPermissionResponse.md) - - [ListApiPermissionResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListApiPermissionResponseLinks.md) - [ListApplicationsResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListApplicationsResponse.md) - - [ListApplicationsResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListApplicationsResponseLinks.md) - [ListAssignmentAuditsResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListAssignmentAuditsResponse.md) - - [ListAssignmentAuditsResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListAssignmentAuditsResponseLinks.md) - [ListAssignmentResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListAssignmentResponse.md) - - [ListAssignmentResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListAssignmentResponseLinks.md) - [ListCredentialResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListCredentialResponse.md) - - [ListCredentialResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListCredentialResponseLinks.md) - [ListDataCenterResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListDataCenterResponse.md) - - [ListDataCenterResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListDataCenterResponseLinks.md) - [ListImageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListImageResponse.md) - [ListImageResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/ListImageResponseData.md) - - [ListImageResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListImageResponseLinks.md) - [ListInstancesActionsAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesActionsAuditResponse.md) - - [ListInstancesActionsAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesActionsAuditResponseLinks.md) - [ListInstancesAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesAuditResponse.md) - - [ListInstancesAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesAuditResponseLinks.md) - [ListInstancesResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesResponse.md) - [ListInstancesResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesResponseData.md) - - [ListInstancesResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesResponseLinks.md) - - [ListInstancesResponsePagination](https://github.com/p-fruck/python-contabo/blob/main/docs/ListInstancesResponsePagination.md) - [ListObjectStorageAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListObjectStorageAuditResponse.md) - - [ListObjectStorageAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListObjectStorageAuditResponseLinks.md) - [ListObjectStorageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListObjectStorageResponse.md) - - [ListObjectStorageResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListObjectStorageResponseLinks.md) - [ListPrivateNetworkAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListPrivateNetworkAuditResponse.md) - - [ListPrivateNetworkAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListPrivateNetworkAuditResponseLinks.md) - [ListPrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListPrivateNetworkResponse.md) - [ListPrivateNetworkResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/ListPrivateNetworkResponseData.md) - - [ListPrivateNetworkResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListPrivateNetworkResponseLinks.md) - [ListRoleAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListRoleAuditResponse.md) - - [ListRoleAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListRoleAuditResponseLinks.md) - [ListRoleResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListRoleResponse.md) - - [ListRoleResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListRoleResponseLinks.md) - [ListSecretAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSecretAuditResponse.md) - - [ListSecretAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSecretAuditResponseLinks.md) - [ListSecretResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSecretResponse.md) - - [ListSecretResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSecretResponseLinks.md) - [ListSnapshotResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSnapshotResponse.md) - - [ListSnapshotResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSnapshotResponseLinks.md) - [ListSnapshotsAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSnapshotsAuditResponse.md) - - [ListSnapshotsAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListSnapshotsAuditResponseLinks.md) - [ListTagAuditsResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListTagAuditsResponse.md) - - [ListTagAuditsResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListTagAuditsResponseLinks.md) - [ListTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListTagResponse.md) - - [ListTagResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListTagResponseLinks.md) - [ListUserAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListUserAuditResponse.md) - - [ListUserAuditResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListUserAuditResponseLinks.md) - [ListUserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ListUserResponse.md) - - [ListUserResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ListUserResponseLinks.md) - [MinimumRequirements](https://github.com/p-fruck/python-contabo/blob/main/docs/MinimumRequirements.md) - [ObjectStorageAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStorageAuditResponse.md) - [ObjectStorageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStorageResponse.md) - - [ObjectStorageResponseAutoScaling](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStorageResponseAutoScaling.md) - [ObjectStoragesStatsResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStoragesStatsResponse.md) - [ObjectStoragesStatsResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStoragesStatsResponseData.md) - - [ObjectStoragesStatsResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/ObjectStoragesStatsResponseLinks.md) - [OptimalRequirements](https://github.com/p-fruck/python-contabo/blob/main/docs/OptimalRequirements.md) - [PaginationMeta](https://github.com/p-fruck/python-contabo/blob/main/docs/PaginationMeta.md) - [PatchInstanceRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/PatchInstanceRequest.md) - [PatchInstanceResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/PatchInstanceResponse.md) - [PatchInstanceResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/PatchInstanceResponseData.md) - - [PatchInstanceResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/PatchInstanceResponseLinks.md) - [PatchObjectStorageRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/PatchObjectStorageRequest.md) - [PatchPrivateNetworkRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/PatchPrivateNetworkRequest.md) - [PatchPrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/PatchPrivateNetworkResponse.md) @@ -446,7 +380,6 @@ - [RoleAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/RoleAuditResponse.md) - [RoleResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/RoleResponse.md) - [RollbackSnapshotResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/RollbackSnapshotResponse.md) - - [RollbackSnapshotResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/RollbackSnapshotResponseLinks.md) - [SecretAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/SecretAuditResponse.md) - [SecretResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/SecretResponse.md) - [SelfLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/SelfLinks.md) @@ -461,36 +394,32 @@ - [UpdateCustomImageResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateCustomImageResponseData.md) - [UpdateRoleRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateRoleRequest.md) - [UpdateRoleResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateRoleResponse.md) - - [UpdateRoleResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateRoleResponseLinks.md) - [UpdateSecretRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateSecretRequest.md) - [UpdateSecretResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateSecretResponse.md) - - [UpdateSecretResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateSecretResponseLinks.md) - [UpdateSnapshotRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateSnapshotRequest.md) - [UpdateSnapshotResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateSnapshotResponse.md) - [UpdateTagRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateTagRequest.md) - [UpdateTagResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateTagResponse.md) - - [UpdateTagResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateTagResponseLinks.md) - [UpdateUserRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateUserRequest.md) - [UpdateUserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateUserResponse.md) - - [UpdateUserResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateUserResponseLinks.md) - [UpgradeAutoScalingType](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeAutoScalingType.md) - [UpgradeInstanceRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeInstanceRequest.md) - [UpgradeObjectStorageRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeObjectStorageRequest.md) - - [UpgradeObjectStorageRequestAutoScaling](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeObjectStorageRequestAutoScaling.md) - [UpgradeObjectStorageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeObjectStorageResponse.md) - [UpgradeObjectStorageResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeObjectStorageResponseData.md) - - [UpgradeObjectStorageResponseDataAutoScaling](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeObjectStorageResponseDataAutoScaling.md) - - [UpgradeObjectStorageResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/UpgradeObjectStorageResponseLinks.md) - [UserAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UserAuditResponse.md) - [UserIsPasswordSetResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UserIsPasswordSetResponse.md) - [UserResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UserResponse.md) - [VncResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/VncResponse.md) + ## Documentation For Authorization -## bearer +Authentication schemes defined for the API: + +### bearer - **Type**: Bearer authentication (JWT) @@ -500,27 +429,7 @@ support@contabo.com -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in pfruck_contabo.apis and pfruck_contabo.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: - -Solution 1: -Use specific imports for apis and models like: -- `from pfruck_contabo.api.default_api import DefaultApi` -- `from pfruck_contabo.model.pet import Pet` - -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import pfruck_contabo -from pfruck_contabo.apis import * -from pfruck_contabo.models import * -``` - """, - long_description_content_type='text/markdown', project_urls={ "Bug Tracker": "https://github.com/p-fruck/python-contabo/issues", }, diff --git a/test-requirements.txt b/test-requirements.txt index bb4f22b..8e6d8cb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1 +1,5 @@ +pytest~=7.1.3 pytest-cov>=2.8.1 +pytest-randomly>=3.12.0 +mypy>=1.4.1 +types-python-dateutil>=2.8.19 From 6c6a009ef6299c109f4c22da569c3cef3c8399ab Mon Sep 17 00:00:00 2001 From: Philipp Fruck Date: Mon, 22 Apr 2024 14:55:43 +0200 Subject: [PATCH 3/3] chore: Update python workflow --- .github/workflows/python.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 471a23b..1151b4c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 @@ -24,15 +24,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + + - name: Run unittests run: | - pytest + python3 -m unittest