quantcdn-client 4.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quantcdn/__init__.py +341 -0
- quantcdn/__version__.py +2 -0
- quantcdn/api/__init__.py +32 -0
- quantcdn/api/ai_agents_api.py +1831 -0
- quantcdn/api/ai_custom_tools_api.py +894 -0
- quantcdn/api/ai_inference_api.py +1224 -0
- quantcdn/api/ai_models_api.py +600 -0
- quantcdn/api/ai_monitoring_api.py +317 -0
- quantcdn/api/ai_sessions_api.py +1875 -0
- quantcdn/api/ai_tools_api.py +1165 -0
- quantcdn/api/ai_vector_database_api.py +1816 -0
- quantcdn/api/applications_api.py +1394 -0
- quantcdn/api/backup_management_api.py +1440 -0
- quantcdn/api/commands_api.py +901 -0
- quantcdn/api/compose_api.py +968 -0
- quantcdn/api/containers_api.py +649 -0
- quantcdn/api/crawler_schedules_api.py +1611 -0
- quantcdn/api/crawlers_api.py +2479 -0
- quantcdn/api/cron_api.py +2212 -0
- quantcdn/api/domains_api.py +1508 -0
- quantcdn/api/environments_api.py +3256 -0
- quantcdn/api/headers_api.py +932 -0
- quantcdn/api/kv_api.py +2868 -0
- quantcdn/api/organizations_api.py +556 -0
- quantcdn/api/projects_api.py +1478 -0
- quantcdn/api/purge_api.py +345 -0
- quantcdn/api/rules_api.py +13520 -0
- quantcdn/api/scaling_policy_api.py +924 -0
- quantcdn/api/ssh_access_api.py +335 -0
- quantcdn/api/variables_api.py +1255 -0
- quantcdn/api/volumes_api.py +1254 -0
- quantcdn/api_client.py +797 -0
- quantcdn/api_response.py +21 -0
- quantcdn/configuration.py +586 -0
- quantcdn/exceptions.py +216 -0
- quantcdn/models/__init__.py +297 -0
- quantcdn/models/application.py +200 -0
- quantcdn/models/application_database.py +103 -0
- quantcdn/models/application_deployment_information_inner.py +96 -0
- quantcdn/models/application_environments_inner.py +93 -0
- quantcdn/models/application_filesystem.py +89 -0
- quantcdn/models/application_image_reference.py +99 -0
- quantcdn/models/bulk_set_environment_variables_request.py +95 -0
- quantcdn/models/bulk_set_environment_variables_request_environment_inner.py +89 -0
- quantcdn/models/chat_inference200_response.py +113 -0
- quantcdn/models/chat_inference200_response_response.py +105 -0
- quantcdn/models/chat_inference200_response_response_tool_use.py +141 -0
- quantcdn/models/chat_inference200_response_response_tool_use_one_of.py +101 -0
- quantcdn/models/chat_inference200_response_response_tool_use_one_of1_inner.py +97 -0
- quantcdn/models/chat_inference200_response_response_tool_use_one_of_result.py +89 -0
- quantcdn/models/chat_inference200_response_usage.py +91 -0
- quantcdn/models/chat_inference_request.py +122 -0
- quantcdn/models/chat_inference_request_messages_inner.py +100 -0
- quantcdn/models/chat_inference_request_messages_inner_content.py +144 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner.py +165 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of.py +87 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of1.py +91 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of1_image.py +100 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of1_image_source.py +87 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of2.py +91 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of2_video.py +100 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of2_video_source.py +87 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of3.py +91 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of3_document.py +102 -0
- quantcdn/models/chat_inference_request_messages_inner_content_one_of_inner_one_of3_document_source.py +87 -0
- quantcdn/models/chat_inference_request_response_format.py +99 -0
- quantcdn/models/chat_inference_request_tool_config.py +99 -0
- quantcdn/models/chat_inference_request_tool_config_tools_inner.py +91 -0
- quantcdn/models/chat_inference_request_tool_config_tools_inner_tool_spec.py +95 -0
- quantcdn/models/chat_inference_request_tool_config_tools_inner_tool_spec_input_schema.py +87 -0
- quantcdn/models/chat_inference_stream_request.py +120 -0
- quantcdn/models/chat_inference_stream_request_messages_inner.py +100 -0
- quantcdn/models/chat_inference_stream_request_messages_inner_content.py +143 -0
- quantcdn/models/chat_with_ai_agent200_response.py +93 -0
- quantcdn/models/chat_with_ai_agent200_response_response.py +97 -0
- quantcdn/models/chat_with_ai_agent200_response_response_usage.py +89 -0
- quantcdn/models/chat_with_ai_agent_request.py +93 -0
- quantcdn/models/command.py +105 -0
- quantcdn/models/compose.py +125 -0
- quantcdn/models/container.py +260 -0
- quantcdn/models/container_depends_on_inner.py +99 -0
- quantcdn/models/container_environment_inner.py +89 -0
- quantcdn/models/container_health_check.py +101 -0
- quantcdn/models/container_image_reference.py +96 -0
- quantcdn/models/container_mount_points_inner.py +91 -0
- quantcdn/models/container_origin_protection_config.py +94 -0
- quantcdn/models/container_secrets_inner.py +89 -0
- quantcdn/models/crawlers_run200_response.py +87 -0
- quantcdn/models/crawlers_run_request.py +87 -0
- quantcdn/models/create_ai_agent201_response.py +91 -0
- quantcdn/models/create_ai_agent_request.py +106 -0
- quantcdn/models/create_ai_session201_response.py +104 -0
- quantcdn/models/create_ai_session_request.py +104 -0
- quantcdn/models/create_ai_session_request_initial_messages_inner.py +99 -0
- quantcdn/models/create_application403_response.py +89 -0
- quantcdn/models/create_application_request.py +144 -0
- quantcdn/models/create_application_request_database.py +103 -0
- quantcdn/models/create_application_request_environment_inner.py +89 -0
- quantcdn/models/create_application_request_filesystem.py +89 -0
- quantcdn/models/create_backup202_response.py +91 -0
- quantcdn/models/create_backup_request.py +87 -0
- quantcdn/models/create_command_request.py +87 -0
- quantcdn/models/create_cron_job_request.py +112 -0
- quantcdn/models/create_custom_tool201_response.py +91 -0
- quantcdn/models/create_custom_tool_request.py +98 -0
- quantcdn/models/create_environment403_response.py +89 -0
- quantcdn/models/create_environment_request.py +130 -0
- quantcdn/models/create_environment_request_environment_inner.py +89 -0
- quantcdn/models/create_vector_collection201_response.py +95 -0
- quantcdn/models/create_vector_collection201_response_collection.py +95 -0
- quantcdn/models/create_vector_collection_request.py +93 -0
- quantcdn/models/create_volume_request.py +101 -0
- quantcdn/models/cron.py +91 -0
- quantcdn/models/cron_run.py +156 -0
- quantcdn/models/delete_ai_agent200_response.py +89 -0
- quantcdn/models/delete_ai_session200_response.py +87 -0
- quantcdn/models/delete_backup200_response.py +89 -0
- quantcdn/models/delete_custom_tool200_response.py +89 -0
- quantcdn/models/delete_vector_collection200_response.py +89 -0
- quantcdn/models/download_backup200_response.py +92 -0
- quantcdn/models/embeddings200_response.py +101 -0
- quantcdn/models/embeddings200_response_embeddings.py +143 -0
- quantcdn/models/embeddings200_response_usage.py +89 -0
- quantcdn/models/embeddings_request.py +107 -0
- quantcdn/models/embeddings_request_input.py +143 -0
- quantcdn/models/environment.py +108 -0
- quantcdn/models/environment_response.py +171 -0
- quantcdn/models/environment_summary.py +109 -0
- quantcdn/models/extend_ai_session200_response.py +92 -0
- quantcdn/models/extend_ai_session_request.py +88 -0
- quantcdn/models/get_ai_agent200_response.py +91 -0
- quantcdn/models/get_ai_agent200_response_agent.py +112 -0
- quantcdn/models/get_ai_model200_response.py +116 -0
- quantcdn/models/get_ai_model200_response_capabilities.py +95 -0
- quantcdn/models/get_ai_model200_response_pricing.py +91 -0
- quantcdn/models/get_ai_model404_response.py +89 -0
- quantcdn/models/get_ai_session200_response.py +96 -0
- quantcdn/models/get_ai_tool_execution_status200_response.py +107 -0
- quantcdn/models/get_ai_tool_execution_status200_response_result.py +89 -0
- quantcdn/models/get_ai_tool_execution_status404_response.py +89 -0
- quantcdn/models/get_ai_usage_stats200_response.py +104 -0
- quantcdn/models/get_ai_usage_stats200_response_by_model_value.py +89 -0
- quantcdn/models/get_ecr_login_credentials200_response.py +93 -0
- quantcdn/models/get_environment_logs200_response.py +102 -0
- quantcdn/models/get_environment_logs200_response_log_events_inner.py +89 -0
- quantcdn/models/get_ssh_access_credentials200_response.py +107 -0
- quantcdn/models/get_ssh_access_credentials200_response_credentials.py +94 -0
- quantcdn/models/get_vector_collection200_response.py +91 -0
- quantcdn/models/get_vector_collection200_response_collection.py +102 -0
- quantcdn/models/image_generation200_response.py +91 -0
- quantcdn/models/image_generation_request.py +152 -0
- quantcdn/models/image_generation_request_background_removal_params.py +87 -0
- quantcdn/models/image_generation_request_color_guided_generation_params.py +94 -0
- quantcdn/models/image_generation_request_image_generation_config.py +108 -0
- quantcdn/models/image_generation_request_image_variation_params.py +94 -0
- quantcdn/models/image_generation_request_in_painting_params.py +96 -0
- quantcdn/models/image_generation_request_out_painting_params.py +107 -0
- quantcdn/models/image_generation_request_text_to_image_params.py +118 -0
- quantcdn/models/kv_items_create200_response.py +91 -0
- quantcdn/models/kv_items_delete200_response.py +89 -0
- quantcdn/models/kv_items_show200_response.py +93 -0
- quantcdn/models/kv_items_show200_response_value.py +143 -0
- quantcdn/models/list_ai_agents200_response.py +95 -0
- quantcdn/models/list_ai_agents200_response_agents_inner.py +106 -0
- quantcdn/models/list_ai_models200_response.py +97 -0
- quantcdn/models/list_ai_models200_response_models_inner.py +97 -0
- quantcdn/models/list_ai_models200_response_models_inner_capabilities.py +95 -0
- quantcdn/models/list_ai_sessions200_response_inner.py +96 -0
- quantcdn/models/list_ai_tool_executions200_response.py +101 -0
- quantcdn/models/list_ai_tool_executions200_response_executions_inner.py +96 -0
- quantcdn/models/list_ai_tool_names200_response.py +89 -0
- quantcdn/models/list_ai_tools200_response.py +97 -0
- quantcdn/models/list_ai_tools200_response_tools_inner.py +91 -0
- quantcdn/models/list_ai_tools200_response_tools_inner_tool_spec.py +95 -0
- quantcdn/models/list_ai_tools200_response_tools_inner_tool_spec_input_schema.py +87 -0
- quantcdn/models/list_backups200_response.py +106 -0
- quantcdn/models/list_backups200_response_backups_inner.py +112 -0
- quantcdn/models/list_backups422_response.py +87 -0
- quantcdn/models/list_custom_tools200_response.py +97 -0
- quantcdn/models/list_custom_tools200_response_tools_inner.py +98 -0
- quantcdn/models/list_vector_collections200_response.py +97 -0
- quantcdn/models/list_vector_collections200_response_collections_inner.py +98 -0
- quantcdn/models/organizations_list200_response_inner.py +89 -0
- quantcdn/models/patch_environment_compose202_response.py +107 -0
- quantcdn/models/patch_environment_compose202_response_spot_configuration.py +89 -0
- quantcdn/models/patch_environment_compose400_response.py +89 -0
- quantcdn/models/patch_environment_compose_request.py +153 -0
- quantcdn/models/patch_environment_compose_request_spot_configuration.py +97 -0
- quantcdn/models/purge_create_request.py +93 -0
- quantcdn/models/query_vector_collection200_response.py +101 -0
- quantcdn/models/query_vector_collection200_response_results_inner.py +95 -0
- quantcdn/models/query_vector_collection200_response_results_inner_metadata.py +91 -0
- quantcdn/models/query_vector_collection_request.py +90 -0
- quantcdn/models/scaling_policy.py +103 -0
- quantcdn/models/spot_configuration.py +94 -0
- quantcdn/models/sync_operation.py +99 -0
- quantcdn/models/sync_to_environment_request.py +87 -0
- quantcdn/models/update_ai_agent200_response.py +91 -0
- quantcdn/models/update_ai_agent_request.py +104 -0
- quantcdn/models/update_ai_session200_response.py +96 -0
- quantcdn/models/update_ai_session_request.py +111 -0
- quantcdn/models/update_ai_session_request_new_messages_inner.py +99 -0
- quantcdn/models/update_cron_job_request.py +120 -0
- quantcdn/models/update_environment_request.py +106 -0
- quantcdn/models/update_environment_state_request.py +89 -0
- quantcdn/models/update_environment_variable_request.py +87 -0
- quantcdn/models/upload_vector_documents200_response.py +93 -0
- quantcdn/models/upload_vector_documents_request.py +95 -0
- quantcdn/models/upload_vector_documents_request_documents_inner.py +93 -0
- quantcdn/models/upload_vector_documents_request_documents_inner_metadata.py +93 -0
- quantcdn/models/v1_content_item.py +97 -0
- quantcdn/models/v1_content_list_response.py +101 -0
- quantcdn/models/v1_content_request.py +110 -0
- quantcdn/models/v1_delete_response.py +99 -0
- quantcdn/models/v1_error.py +89 -0
- quantcdn/models/v1_form_submission_item.py +97 -0
- quantcdn/models/v1_form_submission_list_response.py +101 -0
- quantcdn/models/v1_get_metric_series_response.py +93 -0
- quantcdn/models/v1_get_metric_series_response_data.py +162 -0
- quantcdn/models/v1_get_metrics_response.py +93 -0
- quantcdn/models/v1_get_metrics_response_data.py +163 -0
- quantcdn/models/v1_global_meta_response.py +101 -0
- quantcdn/models/v1_global_meta_response_global_meta.py +87 -0
- quantcdn/models/v1_info.py +99 -0
- quantcdn/models/v1_meta.py +113 -0
- quantcdn/models/v1_metric_day_stats.py +93 -0
- quantcdn/models/v1_metric_minute_stats.py +93 -0
- quantcdn/models/v1_metric_month_stats.py +93 -0
- quantcdn/models/v1_ping_response.py +89 -0
- quantcdn/models/v1_proxy_item.py +95 -0
- quantcdn/models/v1_proxy_list_response.py +101 -0
- quantcdn/models/v1_redirect_item.py +97 -0
- quantcdn/models/v1_redirect_list_response.py +101 -0
- quantcdn/models/v1_redirect_request.py +111 -0
- quantcdn/models/v1_redirect_response.py +121 -0
- quantcdn/models/v1_revision.py +115 -0
- quantcdn/models/v1_revisions_response.py +107 -0
- quantcdn/models/v1_search_hit.py +97 -0
- quantcdn/models/v1_search_items_response.py +97 -0
- quantcdn/models/v1_search_mutation_response.py +91 -0
- quantcdn/models/v1_search_record.py +93 -0
- quantcdn/models/v1_search_response.py +89 -0
- quantcdn/models/v1_series_point_day.py +89 -0
- quantcdn/models/v1_series_point_month.py +89 -0
- quantcdn/models/v1_transition.py +99 -0
- quantcdn/models/v1_upload_response.py +89 -0
- quantcdn/models/v1_url_meta_request.py +87 -0
- quantcdn/models/v1_url_meta_response.py +91 -0
- quantcdn/models/v1_waf_log_item.py +107 -0
- quantcdn/models/v1_waf_log_list_response.py +101 -0
- quantcdn/models/v2_crawler.py +165 -0
- quantcdn/models/v2_crawler_assets.py +97 -0
- quantcdn/models/v2_crawler_assets_network_intercept.py +91 -0
- quantcdn/models/v2_crawler_assets_parser.py +87 -0
- quantcdn/models/v2_crawler_request.py +142 -0
- quantcdn/models/v2_crawler_run.py +114 -0
- quantcdn/models/v2_crawler_schedule.py +104 -0
- quantcdn/models/v2_crawler_schedule_request.py +89 -0
- quantcdn/models/v2_crawler_sitemap_inner.py +89 -0
- quantcdn/models/v2_custom_header_request.py +87 -0
- quantcdn/models/v2_domain.py +121 -0
- quantcdn/models/v2_domain_dns_go_live_records_inner.py +98 -0
- quantcdn/models/v2_domain_dns_validation_records_inner.py +91 -0
- quantcdn/models/v2_domain_request.py +87 -0
- quantcdn/models/v2_error.py +89 -0
- quantcdn/models/v2_organization.py +100 -0
- quantcdn/models/v2_organization_request.py +89 -0
- quantcdn/models/v2_project.py +95 -0
- quantcdn/models/v2_project_request.py +101 -0
- quantcdn/models/v2_rule.py +121 -0
- quantcdn/models/v2_rule_auth.py +127 -0
- quantcdn/models/v2_rule_auth_action.py +89 -0
- quantcdn/models/v2_rule_auth_request.py +119 -0
- quantcdn/models/v2_rule_bot_challenge.py +127 -0
- quantcdn/models/v2_rule_bot_challenge_action.py +91 -0
- quantcdn/models/v2_rule_bot_challenge_request.py +121 -0
- quantcdn/models/v2_rule_content_filter.py +127 -0
- quantcdn/models/v2_rule_content_filter_action.py +87 -0
- quantcdn/models/v2_rule_content_filter_request.py +117 -0
- quantcdn/models/v2_rule_custom_response.py +127 -0
- quantcdn/models/v2_rule_custom_response_action.py +89 -0
- quantcdn/models/v2_rule_custom_response_request.py +123 -0
- quantcdn/models/v2_rule_function.py +127 -0
- quantcdn/models/v2_rule_function_action.py +87 -0
- quantcdn/models/v2_rule_function_request.py +117 -0
- quantcdn/models/v2_rule_header.py +127 -0
- quantcdn/models/v2_rule_header_action.py +87 -0
- quantcdn/models/v2_rule_header_request.py +117 -0
- quantcdn/models/v2_rule_proxy.py +127 -0
- quantcdn/models/v2_rule_proxy_action.py +195 -0
- quantcdn/models/v2_rule_proxy_action_notify_config.py +87 -0
- quantcdn/models/v2_rule_proxy_action_quant_cloud_selection.py +93 -0
- quantcdn/models/v2_rule_proxy_request.py +189 -0
- quantcdn/models/v2_rule_redirect.py +127 -0
- quantcdn/models/v2_rule_redirect_action.py +89 -0
- quantcdn/models/v2_rule_redirect_request.py +119 -0
- quantcdn/models/v2_rule_request.py +115 -0
- quantcdn/models/v2_rule_serve_static.py +127 -0
- quantcdn/models/v2_rule_serve_static_action.py +87 -0
- quantcdn/models/v2_rule_serve_static_request.py +117 -0
- quantcdn/models/v2_secret_store.py +89 -0
- quantcdn/models/v2_secret_store_request.py +87 -0
- quantcdn/models/v2_store.py +89 -0
- quantcdn/models/v2_store_item.py +89 -0
- quantcdn/models/v2_store_item_request.py +91 -0
- quantcdn/models/v2_store_item_update_request.py +89 -0
- quantcdn/models/v2_store_items_list_response.py +94 -0
- quantcdn/models/v2_store_request.py +87 -0
- quantcdn/models/validate_compose200_response.py +96 -0
- quantcdn/models/validate_compose422_response.py +87 -0
- quantcdn/models/validate_compose_request.py +102 -0
- quantcdn/models/variable.py +89 -0
- quantcdn/models/volume.py +101 -0
- quantcdn/models/waf_config.py +140 -0
- quantcdn/models/waf_config_block_lists.py +93 -0
- quantcdn/models/waf_config_httpbl.py +97 -0
- quantcdn/models/waf_config_thresholds_inner.py +131 -0
- quantcdn/py.typed +0 -0
- quantcdn/rest.py +258 -0
- quantcdn_client-4.8.0.dist-info/METADATA +23 -0
- quantcdn_client-4.8.0.dist-info/RECORD +323 -0
- quantcdn_client-4.8.0.dist-info/WHEEL +5 -0
- quantcdn_client-4.8.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QuantCDN API
|
|
5
|
+
|
|
6
|
+
Unified API for QuantCDN Admin and QuantCloud Platform services
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 4.8.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class V2RuleContentFilterAction(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
V2RuleContentFilterAction
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
fn_uuid: StrictStr = Field(description="Function UUID")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["fn_uuid"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of V2RuleContentFilterAction from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of V2RuleContentFilterAction from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"fn_uuid": obj.get("fn_uuid")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QuantCDN API
|
|
5
|
+
|
|
6
|
+
Unified API for QuantCDN Admin and QuantCloud Platform services
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 4.8.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class V2RuleContentFilterRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
V2RuleContentFilterRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
domain: List[StrictStr] = Field(description="Domain patterns (default: any)")
|
|
30
|
+
name: Optional[StrictStr] = Field(default=None, description="Rule name")
|
|
31
|
+
uuid: Optional[StrictStr] = Field(default=None, description="Rule UUID")
|
|
32
|
+
weight: Optional[StrictInt] = Field(default=0, description="Rule weight")
|
|
33
|
+
disabled: Optional[StrictBool] = Field(default=False, description="Whether rule is disabled")
|
|
34
|
+
url: List[StrictStr] = Field(description="URL patterns")
|
|
35
|
+
country: Optional[StrictStr] = Field(default=None, description="Country filter type (country_is, country_is_not, any)")
|
|
36
|
+
country_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed countries")
|
|
37
|
+
country_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded countries")
|
|
38
|
+
method: Optional[StrictStr] = Field(default=None, description="Method filter type (method_is, method_is_not, any)")
|
|
39
|
+
method_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed HTTP methods")
|
|
40
|
+
method_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded HTTP methods")
|
|
41
|
+
ip: Optional[StrictStr] = Field(default=None, description="IP filter type (ip_is, ip_is_not, any)")
|
|
42
|
+
ip_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed IP addresses")
|
|
43
|
+
ip_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded IP addresses")
|
|
44
|
+
fn_uuid: StrictStr = Field(description="Function UUID")
|
|
45
|
+
__properties: ClassVar[List[str]] = ["domain", "name", "uuid", "weight", "disabled", "url", "country", "country_is", "country_is_not", "method", "method_is", "method_is_not", "ip", "ip_is", "ip_is_not", "fn_uuid"]
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
populate_by_name=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
61
|
+
return json.dumps(self.to_dict())
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of V2RuleContentFilterRequest from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([
|
|
79
|
+
])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
return _dict
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of V2RuleContentFilterRequest from a dict"""
|
|
91
|
+
if obj is None:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
if not isinstance(obj, dict):
|
|
95
|
+
return cls.model_validate(obj)
|
|
96
|
+
|
|
97
|
+
_obj = cls.model_validate({
|
|
98
|
+
"domain": obj.get("domain"),
|
|
99
|
+
"name": obj.get("name"),
|
|
100
|
+
"uuid": obj.get("uuid"),
|
|
101
|
+
"weight": obj.get("weight") if obj.get("weight") is not None else 0,
|
|
102
|
+
"disabled": obj.get("disabled") if obj.get("disabled") is not None else False,
|
|
103
|
+
"url": obj.get("url"),
|
|
104
|
+
"country": obj.get("country"),
|
|
105
|
+
"country_is": obj.get("country_is"),
|
|
106
|
+
"country_is_not": obj.get("country_is_not"),
|
|
107
|
+
"method": obj.get("method"),
|
|
108
|
+
"method_is": obj.get("method_is"),
|
|
109
|
+
"method_is_not": obj.get("method_is_not"),
|
|
110
|
+
"ip": obj.get("ip"),
|
|
111
|
+
"ip_is": obj.get("ip_is"),
|
|
112
|
+
"ip_is_not": obj.get("ip_is_not"),
|
|
113
|
+
"fn_uuid": obj.get("fn_uuid")
|
|
114
|
+
})
|
|
115
|
+
return _obj
|
|
116
|
+
|
|
117
|
+
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QuantCDN API
|
|
5
|
+
|
|
6
|
+
Unified API for QuantCDN Admin and QuantCloud Platform services
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 4.8.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from quantcdn.models.v2_rule_custom_response_action import V2RuleCustomResponseAction
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class V2RuleCustomResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
V2RuleCustomResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: Optional[StrictStr] = Field(default=None, description="Rule name")
|
|
31
|
+
uuid: StrictStr = Field(description="Rule UUID")
|
|
32
|
+
rule_id: Optional[StrictStr] = Field(default=None, description="Rule ID")
|
|
33
|
+
weight: Optional[StrictInt] = Field(default=0, description="Rule weight")
|
|
34
|
+
url: Optional[List[StrictStr]] = Field(default=None, description="URL patterns")
|
|
35
|
+
domain: Optional[List[StrictStr]] = Field(default=None, description="Domain patterns")
|
|
36
|
+
disabled: StrictBool = Field(description="Whether rule is disabled")
|
|
37
|
+
only_with_cookie: Optional[StrictStr] = Field(default=None, description="Only apply with cookie")
|
|
38
|
+
method: Optional[StrictStr] = Field(default=None, description="HTTP method")
|
|
39
|
+
method_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed HTTP methods")
|
|
40
|
+
method_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded HTTP methods")
|
|
41
|
+
ip: Optional[StrictStr] = Field(default=None, description="IP address")
|
|
42
|
+
ip_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed IP addresses")
|
|
43
|
+
ip_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded IP addresses")
|
|
44
|
+
country: Optional[StrictStr] = Field(default=None, description="Country code")
|
|
45
|
+
country_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed countries")
|
|
46
|
+
country_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded countries")
|
|
47
|
+
action: StrictStr = Field(description="Rule action")
|
|
48
|
+
action_config: Optional[V2RuleCustomResponseAction] = None
|
|
49
|
+
__properties: ClassVar[List[str]] = ["name", "uuid", "rule_id", "weight", "url", "domain", "disabled", "only_with_cookie", "method", "method_is", "method_is_not", "ip", "ip_is", "ip_is_not", "country", "country_is", "country_is_not", "action", "action_config"]
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
populate_by_name=True,
|
|
53
|
+
validate_assignment=True,
|
|
54
|
+
protected_namespaces=(),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def to_str(self) -> str:
|
|
59
|
+
"""Returns the string representation of the model using alias"""
|
|
60
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
61
|
+
|
|
62
|
+
def to_json(self) -> str:
|
|
63
|
+
"""Returns the JSON representation of the model using alias"""
|
|
64
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
65
|
+
return json.dumps(self.to_dict())
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of V2RuleCustomResponse from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
"""
|
|
82
|
+
excluded_fields: Set[str] = set([
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
_dict = self.model_dump(
|
|
86
|
+
by_alias=True,
|
|
87
|
+
exclude=excluded_fields,
|
|
88
|
+
exclude_none=True,
|
|
89
|
+
)
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of action_config
|
|
91
|
+
if self.action_config:
|
|
92
|
+
_dict['action_config'] = self.action_config.to_dict()
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of V2RuleCustomResponse from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"name": obj.get("name"),
|
|
106
|
+
"uuid": obj.get("uuid"),
|
|
107
|
+
"rule_id": obj.get("rule_id"),
|
|
108
|
+
"weight": obj.get("weight") if obj.get("weight") is not None else 0,
|
|
109
|
+
"url": obj.get("url"),
|
|
110
|
+
"domain": obj.get("domain"),
|
|
111
|
+
"disabled": obj.get("disabled") if obj.get("disabled") is not None else False,
|
|
112
|
+
"only_with_cookie": obj.get("only_with_cookie"),
|
|
113
|
+
"method": obj.get("method"),
|
|
114
|
+
"method_is": obj.get("method_is"),
|
|
115
|
+
"method_is_not": obj.get("method_is_not"),
|
|
116
|
+
"ip": obj.get("ip"),
|
|
117
|
+
"ip_is": obj.get("ip_is"),
|
|
118
|
+
"ip_is_not": obj.get("ip_is_not"),
|
|
119
|
+
"country": obj.get("country"),
|
|
120
|
+
"country_is": obj.get("country_is"),
|
|
121
|
+
"country_is_not": obj.get("country_is_not"),
|
|
122
|
+
"action": obj.get("action"),
|
|
123
|
+
"action_config": V2RuleCustomResponseAction.from_dict(obj["action_config"]) if obj.get("action_config") is not None else None
|
|
124
|
+
})
|
|
125
|
+
return _obj
|
|
126
|
+
|
|
127
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QuantCDN API
|
|
5
|
+
|
|
6
|
+
Unified API for QuantCDN Admin and QuantCloud Platform services
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 4.8.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class V2RuleCustomResponseAction(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
V2RuleCustomResponseAction
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
custom_response_body: StrictStr = Field(description="Custom response body content")
|
|
30
|
+
custom_response_status_code: Optional[StrictInt] = Field(default=200, description="HTTP status code for custom response")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["custom_response_body", "custom_response_status_code"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of V2RuleCustomResponseAction from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of V2RuleCustomResponseAction from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"custom_response_body": obj.get("custom_response_body"),
|
|
85
|
+
"custom_response_status_code": obj.get("custom_response_status_code") if obj.get("custom_response_status_code") is not None else 200
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QuantCDN API
|
|
5
|
+
|
|
6
|
+
Unified API for QuantCDN Admin and QuantCloud Platform services
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 4.8.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class V2RuleCustomResponseRequest(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
V2RuleCustomResponseRequest
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
domain: List[StrictStr] = Field(description="Domain patterns (default: any)")
|
|
30
|
+
name: Optional[StrictStr] = Field(default=None, description="Rule name")
|
|
31
|
+
uuid: Optional[StrictStr] = Field(default=None, description="Rule UUID")
|
|
32
|
+
weight: Optional[StrictInt] = Field(default=0, description="Rule weight")
|
|
33
|
+
disabled: Optional[StrictBool] = Field(default=False, description="Whether rule is disabled")
|
|
34
|
+
url: List[StrictStr] = Field(description="URL patterns")
|
|
35
|
+
country: Optional[StrictStr] = Field(default=None, description="Country filter type (country_is, country_is_not, any)")
|
|
36
|
+
country_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed countries")
|
|
37
|
+
country_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded countries")
|
|
38
|
+
method: Optional[StrictStr] = Field(default=None, description="Method filter type (method_is, method_is_not, any)")
|
|
39
|
+
method_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed HTTP methods")
|
|
40
|
+
method_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded HTTP methods")
|
|
41
|
+
ip: Optional[StrictStr] = Field(default=None, description="IP filter type (ip_is, ip_is_not, any)")
|
|
42
|
+
ip_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed IP addresses")
|
|
43
|
+
ip_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded IP addresses")
|
|
44
|
+
custom_response_body: StrictStr = Field(description="Custom response body content")
|
|
45
|
+
custom_response_status_code: Optional[StrictInt] = Field(default=200, description="HTTP status code for custom response")
|
|
46
|
+
status_code: Optional[StrictInt] = Field(default=None, description="Legacy field for status code (deprecated)")
|
|
47
|
+
body: Optional[StrictStr] = Field(default=None, description="Legacy field for response body (deprecated)")
|
|
48
|
+
__properties: ClassVar[List[str]] = ["domain", "name", "uuid", "weight", "disabled", "url", "country", "country_is", "country_is_not", "method", "method_is", "method_is_not", "ip", "ip_is", "ip_is_not", "custom_response_body", "custom_response_status_code", "status_code", "body"]
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(
|
|
51
|
+
populate_by_name=True,
|
|
52
|
+
validate_assignment=True,
|
|
53
|
+
protected_namespaces=(),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def to_str(self) -> str:
|
|
58
|
+
"""Returns the string representation of the model using alias"""
|
|
59
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
60
|
+
|
|
61
|
+
def to_json(self) -> str:
|
|
62
|
+
"""Returns the JSON representation of the model using alias"""
|
|
63
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
64
|
+
return json.dumps(self.to_dict())
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
68
|
+
"""Create an instance of V2RuleCustomResponseRequest from a JSON string"""
|
|
69
|
+
return cls.from_dict(json.loads(json_str))
|
|
70
|
+
|
|
71
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
72
|
+
"""Return the dictionary representation of the model using alias.
|
|
73
|
+
|
|
74
|
+
This has the following differences from calling pydantic's
|
|
75
|
+
`self.model_dump(by_alias=True)`:
|
|
76
|
+
|
|
77
|
+
* `None` is only added to the output dict for nullable fields that
|
|
78
|
+
were set at model initialization. Other fields with value `None`
|
|
79
|
+
are ignored.
|
|
80
|
+
"""
|
|
81
|
+
excluded_fields: Set[str] = set([
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
_dict = self.model_dump(
|
|
85
|
+
by_alias=True,
|
|
86
|
+
exclude=excluded_fields,
|
|
87
|
+
exclude_none=True,
|
|
88
|
+
)
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of V2RuleCustomResponseRequest from a dict"""
|
|
94
|
+
if obj is None:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
if not isinstance(obj, dict):
|
|
98
|
+
return cls.model_validate(obj)
|
|
99
|
+
|
|
100
|
+
_obj = cls.model_validate({
|
|
101
|
+
"domain": obj.get("domain"),
|
|
102
|
+
"name": obj.get("name"),
|
|
103
|
+
"uuid": obj.get("uuid"),
|
|
104
|
+
"weight": obj.get("weight") if obj.get("weight") is not None else 0,
|
|
105
|
+
"disabled": obj.get("disabled") if obj.get("disabled") is not None else False,
|
|
106
|
+
"url": obj.get("url"),
|
|
107
|
+
"country": obj.get("country"),
|
|
108
|
+
"country_is": obj.get("country_is"),
|
|
109
|
+
"country_is_not": obj.get("country_is_not"),
|
|
110
|
+
"method": obj.get("method"),
|
|
111
|
+
"method_is": obj.get("method_is"),
|
|
112
|
+
"method_is_not": obj.get("method_is_not"),
|
|
113
|
+
"ip": obj.get("ip"),
|
|
114
|
+
"ip_is": obj.get("ip_is"),
|
|
115
|
+
"ip_is_not": obj.get("ip_is_not"),
|
|
116
|
+
"custom_response_body": obj.get("custom_response_body"),
|
|
117
|
+
"custom_response_status_code": obj.get("custom_response_status_code") if obj.get("custom_response_status_code") is not None else 200,
|
|
118
|
+
"status_code": obj.get("status_code"),
|
|
119
|
+
"body": obj.get("body")
|
|
120
|
+
})
|
|
121
|
+
return _obj
|
|
122
|
+
|
|
123
|
+
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
QuantCDN API
|
|
5
|
+
|
|
6
|
+
Unified API for QuantCDN Admin and QuantCloud Platform services
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 4.8.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from quantcdn.models.v2_rule_function_action import V2RuleFunctionAction
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class V2RuleFunction(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
V2RuleFunction
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: Optional[StrictStr] = Field(default=None, description="Rule name")
|
|
31
|
+
uuid: StrictStr = Field(description="Rule UUID")
|
|
32
|
+
rule_id: Optional[StrictStr] = Field(default=None, description="Rule ID")
|
|
33
|
+
weight: Optional[StrictInt] = Field(default=0, description="Rule weight")
|
|
34
|
+
url: Optional[List[StrictStr]] = Field(default=None, description="URL patterns")
|
|
35
|
+
domain: Optional[List[StrictStr]] = Field(default=None, description="Domain patterns")
|
|
36
|
+
disabled: StrictBool = Field(description="Whether rule is disabled")
|
|
37
|
+
only_with_cookie: Optional[StrictStr] = Field(default=None, description="Only apply with cookie")
|
|
38
|
+
method: Optional[StrictStr] = Field(default=None, description="HTTP method")
|
|
39
|
+
method_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed HTTP methods")
|
|
40
|
+
method_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded HTTP methods")
|
|
41
|
+
ip: Optional[StrictStr] = Field(default=None, description="IP address")
|
|
42
|
+
ip_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed IP addresses")
|
|
43
|
+
ip_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded IP addresses")
|
|
44
|
+
country: Optional[StrictStr] = Field(default=None, description="Country code")
|
|
45
|
+
country_is: Optional[List[StrictStr]] = Field(default=None, description="Allowed countries")
|
|
46
|
+
country_is_not: Optional[List[StrictStr]] = Field(default=None, description="Excluded countries")
|
|
47
|
+
action: StrictStr = Field(description="Rule action")
|
|
48
|
+
action_config: V2RuleFunctionAction
|
|
49
|
+
__properties: ClassVar[List[str]] = ["name", "uuid", "rule_id", "weight", "url", "domain", "disabled", "only_with_cookie", "method", "method_is", "method_is_not", "ip", "ip_is", "ip_is_not", "country", "country_is", "country_is_not", "action", "action_config"]
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
populate_by_name=True,
|
|
53
|
+
validate_assignment=True,
|
|
54
|
+
protected_namespaces=(),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def to_str(self) -> str:
|
|
59
|
+
"""Returns the string representation of the model using alias"""
|
|
60
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
61
|
+
|
|
62
|
+
def to_json(self) -> str:
|
|
63
|
+
"""Returns the JSON representation of the model using alias"""
|
|
64
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
65
|
+
return json.dumps(self.to_dict())
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of V2RuleFunction from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
"""
|
|
82
|
+
excluded_fields: Set[str] = set([
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
_dict = self.model_dump(
|
|
86
|
+
by_alias=True,
|
|
87
|
+
exclude=excluded_fields,
|
|
88
|
+
exclude_none=True,
|
|
89
|
+
)
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of action_config
|
|
91
|
+
if self.action_config:
|
|
92
|
+
_dict['action_config'] = self.action_config.to_dict()
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of V2RuleFunction from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"name": obj.get("name"),
|
|
106
|
+
"uuid": obj.get("uuid"),
|
|
107
|
+
"rule_id": obj.get("rule_id"),
|
|
108
|
+
"weight": obj.get("weight") if obj.get("weight") is not None else 0,
|
|
109
|
+
"url": obj.get("url"),
|
|
110
|
+
"domain": obj.get("domain"),
|
|
111
|
+
"disabled": obj.get("disabled") if obj.get("disabled") is not None else False,
|
|
112
|
+
"only_with_cookie": obj.get("only_with_cookie"),
|
|
113
|
+
"method": obj.get("method"),
|
|
114
|
+
"method_is": obj.get("method_is"),
|
|
115
|
+
"method_is_not": obj.get("method_is_not"),
|
|
116
|
+
"ip": obj.get("ip"),
|
|
117
|
+
"ip_is": obj.get("ip_is"),
|
|
118
|
+
"ip_is_not": obj.get("ip_is_not"),
|
|
119
|
+
"country": obj.get("country"),
|
|
120
|
+
"country_is": obj.get("country_is"),
|
|
121
|
+
"country_is_not": obj.get("country_is_not"),
|
|
122
|
+
"action": obj.get("action"),
|
|
123
|
+
"action_config": V2RuleFunctionAction.from_dict(obj["action_config"]) if obj.get("action_config") is not None else None
|
|
124
|
+
})
|
|
125
|
+
return _obj
|
|
126
|
+
|
|
127
|
+
|