From dc79f286b134d0ce1d789b1faf119a24eb991904 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Fri, 24 Apr 2026 16:58:38 -0700 Subject: [PATCH 01/13] v1.0.10 resources --- scm/__init__.py | 25 + .../api/config_versions_api.py | 60 + scm/config_operations/rest.py | 6 + scm/config_setup/__init__.py | 2 + scm/config_setup/api/__init__.py | 1 + scm/config_setup/api/devices_api.py | 1006 +++++++++++ scm/config_setup/docs/Devices.md | 2 +- scm/config_setup/docs/DevicesApi.md | 270 +++ scm/config_setup/docs/DevicesListResponse.md | 32 + scm/config_setup/models/__init__.py | 1 + scm/config_setup/models/devices.py | 3 +- .../models/devices_list_response.py | 113 ++ scm/config_setup/rest.py | 6 + scm/config_setup/tests/api_devices_test.py | 169 ++ .../api/bandwidth_allocations_api.py | 60 + .../docs/ServiceConnections.md | 1 + .../docs/ServiceConnectionsBgpPeer.md | 1 + .../models/service_connections.py | 4 +- .../models/service_connections_bgp_peer.py | 6 +- scm/deployment_services/rest.py | 6 + .../tests/api_bandwidth_allocations_test.py | 31 + .../api_service_connection_groups_test.py | 26 + .../tests/api_service_connections_test.py | 26 + scm/device_settings/rest.py | 6 + scm/identity_services/api/certificates_api.py | 83 +- scm/identity_services/docs/CertificatesApi.md | 28 +- scm/identity_services/docs/CertificatesGet.md | 4 +- .../MfaServersMfaVendorTypeOktaAdaptiveV1.md | 2 +- .../models/certificates_get.py | 5 +- .../models/export_certificate_payload.py | 7 +- ...ervers_mfa_vendor_type_okta_adaptive_v1.py | 4 +- scm/identity_services/rest.py | 6 + .../tests/api_authentication_rules_test.py | 28 + .../tests/api_certificates_test.py | 329 +++- scm/mobile_agent/__init__.py | 70 + scm/mobile_agent/api/__init__.py | 9 + scm/mobile_agent/api/destinations_api.py | 1602 +++++++++++++++++ .../api/forwarding_profiles_api.py | 1602 +++++++++++++++++ .../api/regional_and_custom_proxies_api.py | 1602 +++++++++++++++++ .../api/source_applications_api.py | 1602 +++++++++++++++++ scm/mobile_agent/api/user_locations_api.py | 1602 +++++++++++++++++ scm/mobile_agent/api_client.py | 798 ++++++++ scm/mobile_agent/api_response.py | 21 + scm/mobile_agent/configuration.py | 471 +++++ scm/mobile_agent/docs/BlockRuleBasic.md | 32 + .../docs/BlockRuleBasicAllowTcp.md | 31 + .../docs/BlockRuleBasicAllowUdp.md | 33 + scm/mobile_agent/docs/BlockRuleZtna.md | 36 + scm/mobile_agent/docs/DestinationsApi.md | 437 +++++ scm/mobile_agent/docs/ErrorDetailCauseInfo.md | 33 + .../ForwardingProfileDestinationFqdnEntry.md | 31 + .../ForwardingProfileDestinationIpEntry.md | 31 + .../docs/ForwardingProfileDestinations.md | 33 + .../ForwardingProfileGlobalProtectProxy.md | 30 + ...ileGlobalProtectProxyGlobalProtectProxy.md | 32 + .../docs/ForwardingProfilePacFile.md | 30 + .../docs/ForwardingProfilePacFilePacFile.md | 32 + ...rwardingProfileRegionalAndCustomProxies.md | 38 + ...ustomProxiesConnectivityPreferenceInner.md | 30 + ...CustomProxiesPrismaAccessLocationsInner.md | 30 + ...ngProfileRegionalAndCustomProxiesProxy1.md | 32 + ...ngProfileRegionalAndCustomProxiesProxy2.md | 32 + .../ForwardingProfileSourceApplications.md | 32 + .../docs/ForwardingProfileUserLocations.md | 33 + ...ofileUserLocationsInternalHostDetection.md | 31 + .../docs/ForwardingProfileZtnaAgent.md | 30 + .../ForwardingProfileZtnaAgentZtnaAgent.md | 32 + scm/mobile_agent/docs/ForwardingProfiles.md | 33 + .../docs/ForwardingProfilesApi.md | 437 +++++ .../docs/ForwardingProfilesType.md | 32 + scm/mobile_agent/docs/ForwardingRuleBasic.md | 34 + scm/mobile_agent/docs/ForwardingRuleZtna.md | 36 + scm/mobile_agent/docs/GenericError.md | 31 + .../GlobalProtectDestinationsListResponse.md | 32 + ...alProtectForwardingProfilesListResponse.md | 32 + ...ectRegionalAndCustomProxiesListResponse.md | 32 + ...alProtectSourceApplicationsListResponse.md | 32 + .../GlobalProtectUserLocationsListResponse.md | 32 + .../docs/RegionalAndCustomProxiesApi.md | 437 +++++ .../docs/SourceApplicationsApi.md | 437 +++++ scm/mobile_agent/docs/UserLocationsApi.md | 437 +++++ scm/mobile_agent/exceptions.py | 200 ++ scm/mobile_agent/models/__init__.py | 49 + scm/mobile_agent/models/block_rule_basic.py | 100 + .../models/block_rule_basic_allow_tcp.py | 91 + .../models/block_rule_basic_allow_udp.py | 95 + scm/mobile_agent/models/block_rule_ztna.py | 100 + .../models/error_detail_cause_info.py | 99 + ...rwarding_profile_destination_fqdn_entry.py | 98 + ...forwarding_profile_destination_ip_entry.py | 98 + .../models/forwarding_profile_destinations.py | 122 ++ ...forwarding_profile_global_protect_proxy.py | 92 + ...obal_protect_proxy_global_protect_proxy.py | 104 ++ .../models/forwarding_profile_pac_file.py | 92 + .../forwarding_profile_pac_file_pac_file.py | 104 ++ ...ing_profile_regional_and_custom_proxies.py | 170 ++ ...m_proxies_connectivity_preference_inner.py | 97 + ...m_proxies_prisma_access_locations_inner.py | 98 + ...file_regional_and_custom_proxies_proxy1.py | 103 ++ ...file_regional_and_custom_proxies_proxy2.py | 103 ++ .../forwarding_profile_source_applications.py | 104 ++ .../forwarding_profile_user_locations.py | 113 ++ ..._user_locations_internal_host_detection.py | 105 ++ .../models/forwarding_profile_ztna_agent.py | 92 + ...orwarding_profile_ztna_agent_ztna_agent.py | 104 ++ .../models/forwarding_profiles.py | 120 ++ .../models/forwarding_profiles_type.py | 104 ++ .../models/forwarding_rule_basic.py | 104 ++ .../models/forwarding_rule_ztna.py | 118 ++ scm/mobile_agent/models/generic_error.py | 98 + ...obal_protect_destinations_list_response.py | 113 ++ ...otect_forwarding_profiles_list_response.py | 113 ++ ...gional_and_custom_proxies_list_response.py | 113 ++ ...otect_source_applications_list_response.py | 113 ++ ...al_protect_user_locations_list_response.py | 113 ++ scm/mobile_agent/rest.py | 264 +++ scm/mobile_agent/tests/__init__.py | 0 .../tests/api_destinations_test.py | 383 ++++ .../tests/api_forwarding_profiles_test.py | 329 ++++ .../api_regional_and_custom_proxies_test.py | 527 ++++++ .../tests/api_source_applications_test.py | 383 ++++ .../tests/api_user_locations_test.py | 514 ++++++ scm/network_services/rest.py | 6 + .../tests/api_ipsec_crypto_profiles_test.py | 26 + .../tests/api_ipsec_tunnels_test.py | 26 + .../tests/api_nat_rules_test.py | 28 + .../tests/api_qos_profiles_test.py | 26 + .../tests/api_qos_rules_test.py | 28 + scm/network_services/tests/api_zones_test.py | 20 +- scm/objects/rest.py | 6 + scm/objects/tests/api_applications_test.py | 26 + .../tests/api_auto_tag_actions_test.py | 54 + scm/objects/tests/api_regions_test.py | 57 +- ...nternetRuleTypeAllowWebApplicationInner.md | 1 + ...t_rule_type_allow_web_application_inner.py | 4 +- scm/security_services/rest.py | 6 + .../api_application_override_rules_test.py | 28 + .../tests/api_decryption_rules_test.py | 28 + .../tests/api_security_rules_test.py | 28 + 139 files changed, 21316 insertions(+), 77 deletions(-) create mode 100644 scm/config_setup/api/devices_api.py create mode 100644 scm/config_setup/docs/DevicesApi.md create mode 100644 scm/config_setup/docs/DevicesListResponse.md create mode 100644 scm/config_setup/models/devices_list_response.py create mode 100644 scm/config_setup/tests/api_devices_test.py create mode 100644 scm/mobile_agent/__init__.py create mode 100644 scm/mobile_agent/api/__init__.py create mode 100644 scm/mobile_agent/api/destinations_api.py create mode 100644 scm/mobile_agent/api/forwarding_profiles_api.py create mode 100644 scm/mobile_agent/api/regional_and_custom_proxies_api.py create mode 100644 scm/mobile_agent/api/source_applications_api.py create mode 100644 scm/mobile_agent/api/user_locations_api.py create mode 100644 scm/mobile_agent/api_client.py create mode 100644 scm/mobile_agent/api_response.py create mode 100644 scm/mobile_agent/configuration.py create mode 100644 scm/mobile_agent/docs/BlockRuleBasic.md create mode 100644 scm/mobile_agent/docs/BlockRuleBasicAllowTcp.md create mode 100644 scm/mobile_agent/docs/BlockRuleBasicAllowUdp.md create mode 100644 scm/mobile_agent/docs/BlockRuleZtna.md create mode 100644 scm/mobile_agent/docs/DestinationsApi.md create mode 100644 scm/mobile_agent/docs/ErrorDetailCauseInfo.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileDestinationFqdnEntry.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileDestinationIpEntry.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileDestinations.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxy.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxyGlobalProtectProxy.md create mode 100644 scm/mobile_agent/docs/ForwardingProfilePacFile.md create mode 100644 scm/mobile_agent/docs/ForwardingProfilePacFilePacFile.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxies.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy1.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy2.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileSourceApplications.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileUserLocations.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileUserLocationsInternalHostDetection.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileZtnaAgent.md create mode 100644 scm/mobile_agent/docs/ForwardingProfileZtnaAgentZtnaAgent.md create mode 100644 scm/mobile_agent/docs/ForwardingProfiles.md create mode 100644 scm/mobile_agent/docs/ForwardingProfilesApi.md create mode 100644 scm/mobile_agent/docs/ForwardingProfilesType.md create mode 100644 scm/mobile_agent/docs/ForwardingRuleBasic.md create mode 100644 scm/mobile_agent/docs/ForwardingRuleZtna.md create mode 100644 scm/mobile_agent/docs/GenericError.md create mode 100644 scm/mobile_agent/docs/GlobalProtectDestinationsListResponse.md create mode 100644 scm/mobile_agent/docs/GlobalProtectForwardingProfilesListResponse.md create mode 100644 scm/mobile_agent/docs/GlobalProtectRegionalAndCustomProxiesListResponse.md create mode 100644 scm/mobile_agent/docs/GlobalProtectSourceApplicationsListResponse.md create mode 100644 scm/mobile_agent/docs/GlobalProtectUserLocationsListResponse.md create mode 100644 scm/mobile_agent/docs/RegionalAndCustomProxiesApi.md create mode 100644 scm/mobile_agent/docs/SourceApplicationsApi.md create mode 100644 scm/mobile_agent/docs/UserLocationsApi.md create mode 100644 scm/mobile_agent/exceptions.py create mode 100644 scm/mobile_agent/models/__init__.py create mode 100644 scm/mobile_agent/models/block_rule_basic.py create mode 100644 scm/mobile_agent/models/block_rule_basic_allow_tcp.py create mode 100644 scm/mobile_agent/models/block_rule_basic_allow_udp.py create mode 100644 scm/mobile_agent/models/block_rule_ztna.py create mode 100644 scm/mobile_agent/models/error_detail_cause_info.py create mode 100644 scm/mobile_agent/models/forwarding_profile_destination_fqdn_entry.py create mode 100644 scm/mobile_agent/models/forwarding_profile_destination_ip_entry.py create mode 100644 scm/mobile_agent/models/forwarding_profile_destinations.py create mode 100644 scm/mobile_agent/models/forwarding_profile_global_protect_proxy.py create mode 100644 scm/mobile_agent/models/forwarding_profile_global_protect_proxy_global_protect_proxy.py create mode 100644 scm/mobile_agent/models/forwarding_profile_pac_file.py create mode 100644 scm/mobile_agent/models/forwarding_profile_pac_file_pac_file.py create mode 100644 scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies.py create mode 100644 scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner.py create mode 100644 scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner.py create mode 100644 scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy1.py create mode 100644 scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy2.py create mode 100644 scm/mobile_agent/models/forwarding_profile_source_applications.py create mode 100644 scm/mobile_agent/models/forwarding_profile_user_locations.py create mode 100644 scm/mobile_agent/models/forwarding_profile_user_locations_internal_host_detection.py create mode 100644 scm/mobile_agent/models/forwarding_profile_ztna_agent.py create mode 100644 scm/mobile_agent/models/forwarding_profile_ztna_agent_ztna_agent.py create mode 100644 scm/mobile_agent/models/forwarding_profiles.py create mode 100644 scm/mobile_agent/models/forwarding_profiles_type.py create mode 100644 scm/mobile_agent/models/forwarding_rule_basic.py create mode 100644 scm/mobile_agent/models/forwarding_rule_ztna.py create mode 100644 scm/mobile_agent/models/generic_error.py create mode 100644 scm/mobile_agent/models/global_protect_destinations_list_response.py create mode 100644 scm/mobile_agent/models/global_protect_forwarding_profiles_list_response.py create mode 100644 scm/mobile_agent/models/global_protect_regional_and_custom_proxies_list_response.py create mode 100644 scm/mobile_agent/models/global_protect_source_applications_list_response.py create mode 100644 scm/mobile_agent/models/global_protect_user_locations_list_response.py create mode 100644 scm/mobile_agent/rest.py create mode 100644 scm/mobile_agent/tests/__init__.py create mode 100644 scm/mobile_agent/tests/api_destinations_test.py create mode 100644 scm/mobile_agent/tests/api_forwarding_profiles_test.py create mode 100644 scm/mobile_agent/tests/api_regional_and_custom_proxies_test.py create mode 100644 scm/mobile_agent/tests/api_source_applications_test.py create mode 100644 scm/mobile_agent/tests/api_user_locations_test.py create mode 100644 scm/objects/tests/api_auto_tag_actions_test.py diff --git a/scm/__init__.py b/scm/__init__.py index 20be764f..133108f3 100644 --- a/scm/__init__.py +++ b/scm/__init__.py @@ -28,6 +28,9 @@ from scm.identity_services import api as identity_services_api from scm.identity_services.api_client import ApiClient as IdentityServicesApiClient from scm.identity_services.configuration import Configuration as IdentityServicesConfiguration +from scm.mobile_agent import api as mobile_agent_api +from scm.mobile_agent.api_client import ApiClient as MobileAgentApiClient +from scm.mobile_agent.configuration import Configuration as MobileAgentConfiguration from scm.network_services import api as network_services_api from scm.network_services.api_client import ApiClient as NetworkServicesApiClient from scm.network_services.configuration import Configuration as NetworkServicesConfiguration @@ -328,6 +331,7 @@ def __init__( self.deployment_services = self._init_deployment_services_client() self.device_settings = self._init_device_settings_client() self.identity_services = self._init_identity_services_client() + self.mobile_agent = self._init_mobile_agent_client() self.network_services = self._init_network_services_client() self.objects = self._init_objects_client() self.security_services = self._init_security_services_client() @@ -515,6 +519,8 @@ def _update_all_sub_clients(self) -> None: self.device_settings.api_client.configuration.access_token = self._access_token if hasattr(self, 'identity_services') and hasattr(self.identity_services, 'api_client'): self.identity_services.api_client.configuration.access_token = self._access_token + if hasattr(self, 'mobile_agent') and hasattr(self.mobile_agent, 'api_client'): + self.mobile_agent.api_client.configuration.access_token = self._access_token if hasattr(self, 'network_services') and hasattr(self.network_services, 'api_client'): self.network_services.api_client.configuration.access_token = self._access_token if hasattr(self, 'objects') and hasattr(self.objects, 'api_client'): @@ -636,6 +642,25 @@ def _init_identity_services_client(self): identity_services_api.api_client = client return identity_services_api + def _init_mobile_agent_client(self): + # Construct base URL by appending the service-specific path suffix + # Host: https://api.sase.paloaltonetworks.com + # Suffix: /config/mobile-agent/v1 + config = MobileAgentConfiguration( + host=f"https://{self.host}/config/mobile-agent/v1" + ) + config.verify_ssl = self.verify_ssl + config.access_token = self._access_token + + client = MobileAgentApiClient(config) + + # Wrap the rest client's request method to auto-refresh tokens + client.rest_client.request = _create_auto_refresh_wrapper( + self, client.rest_client.request + ) + + mobile_agent_api.api_client = client + return mobile_agent_api def _init_network_services_client(self): # Construct base URL by appending the service-specific path suffix # Host: https://api.sase.paloaltonetworks.com diff --git a/scm/config_operations/api/config_versions_api.py b/scm/config_operations/api/config_versions_api.py index ef19387d..53a9141c 100644 --- a/scm/config_operations/api/config_versions_api.py +++ b/scm/config_operations/api/config_versions_api.py @@ -1643,6 +1643,66 @@ def push_candidate_config_versions_without_preload_content( return response_data.response + + def fetch_config_versions( + self, + name: str, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single config_versions object by name. + + This is a convenience method that uses client-side pagination to retrieve + a specific object by its name. It iterates through all pages of results + until the matching object is found. + + Args: + name: The name of the object to fetch + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_config_versions(name="my-object") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + offset = 0 + limit = 5000 + + while True: + # Build list parameters with pagination + list_params = {'offset': offset, 'limit': limit} + # Add any additional kwargs + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit']}) + + try: + response = self.list_config_versions(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Search for exact name match in response + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name') and obj.name == name: + return obj + + # Check if we've reached the end (less than limit returned) + if len(response.data) < limit: + break + else: + break + + offset += limit + + return None + def _push_candidate_config_versions_serialize( self, push_candidate_config_versions_request, diff --git a/scm/config_operations/rest.py b/scm/config_operations/rest.py index 210f50c1..c4fa8504 100644 --- a/scm/config_operations/rest.py +++ b/scm/config_operations/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/config_setup/__init__.py b/scm/config_setup/__init__.py index 27d7b45c..20647cf6 100644 --- a/scm/config_setup/__init__.py +++ b/scm/config_setup/__init__.py @@ -18,6 +18,7 @@ __version__ = "1.0.0" # import apis into sdk package +from scm.config_setup.api.devices_api import DevicesApi from scm.config_setup.api.folders_api import FoldersApi from scm.config_setup.api.labels_api import LabelsApi from scm.config_setup.api.shared_snippets_api import SharedSnippetsApi @@ -52,6 +53,7 @@ from scm.config_setup.models.devices import Devices from scm.config_setup.models.devices_available_licensess_inner import DevicesAvailableLicensessInner from scm.config_setup.models.devices_installed_licenses_inner import DevicesInstalledLicensesInner +from scm.config_setup.models.devices_list_response import DevicesListResponse from scm.config_setup.models.devices_put import DevicesPut from scm.config_setup.models.error_detail_cause_info import ErrorDetailCauseInfo from scm.config_setup.models.folders import Folders diff --git a/scm/config_setup/api/__init__.py b/scm/config_setup/api/__init__.py index 0f22710d..81ade884 100644 --- a/scm/config_setup/api/__init__.py +++ b/scm/config_setup/api/__init__.py @@ -1,6 +1,7 @@ # flake8: noqa # import apis into api package +from scm.config_setup.api.devices_api import DevicesApi from scm.config_setup.api.folders_api import FoldersApi from scm.config_setup.api.labels_api import LabelsApi from scm.config_setup.api.shared_snippets_api import SharedSnippetsApi diff --git a/scm/config_setup/api/devices_api.py b/scm/config_setup/api/devices_api.py new file mode 100644 index 00000000..e2e67d63 --- /dev/null +++ b/scm/config_setup/api/devices_api.py @@ -0,0 +1,1006 @@ +# coding: utf-8 + +""" + Configuration Setup + + These APIs are used to define how Strata Cloud Manager configurations are implemented. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr +from typing import Optional +from typing_extensions import Annotated +from scm.config_setup.models.devices import Devices +from scm.config_setup.models.devices_list_response import DevicesListResponse +from scm.config_setup.models.devices_put import DevicesPut + +from scm.config_setup.api_client import ApiClient, RequestSerialized +from scm.config_setup.api_response import ApiResponse +from scm.config_setup.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class DevicesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def get_device_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Devices: + """Get a device + + Retrieve an existing device. + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Devices", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_device_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[Devices]: + """Get a device + + Retrieve an existing device. + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Devices", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_device_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a device + + Retrieve an existing device. + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_device_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Devices", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_device_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_devices( + self, + pagination: Annotated[Optional[StrictBool], Field(description="The parameter to mention if the response should be paginated. By default, its set to false")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of resources to return")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of resources returned")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the resource")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DevicesListResponse: + """List devices + + Retrieve a list of devices. + + :param pagination: The parameter to mention if the response should be paginated. By default, its set to false + :type pagination: bool + :param limit: The maximum number of resources to return + :type limit: int + :param offset: The offset into the list of resources returned + :type offset: int + :param name: The name of the resource + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_devices_serialize( + pagination=pagination, + limit=limit, + offset=offset, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DevicesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_devices_with_http_info( + self, + pagination: Annotated[Optional[StrictBool], Field(description="The parameter to mention if the response should be paginated. By default, its set to false")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of resources to return")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of resources returned")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the resource")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[DevicesListResponse]: + """List devices + + Retrieve a list of devices. + + :param pagination: The parameter to mention if the response should be paginated. By default, its set to false + :type pagination: bool + :param limit: The maximum number of resources to return + :type limit: int + :param offset: The offset into the list of resources returned + :type offset: int + :param name: The name of the resource + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_devices_serialize( + pagination=pagination, + limit=limit, + offset=offset, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DevicesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_devices_without_preload_content( + self, + pagination: Annotated[Optional[StrictBool], Field(description="The parameter to mention if the response should be paginated. By default, its set to false")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of resources to return")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of resources returned")] = None, + name: Annotated[Optional[StrictStr], Field(description="The name of the resource")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List devices + + Retrieve a list of devices. + + :param pagination: The parameter to mention if the response should be paginated. By default, its set to false + :type pagination: bool + :param limit: The maximum number of resources to return + :type limit: int + :param offset: The offset into the list of resources returned + :type offset: int + :param name: The name of the resource + :type name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_devices_serialize( + pagination=pagination, + limit=limit, + offset=offset, + name=name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DevicesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_devices_serialize( + self, + pagination, + limit, + offset, + name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if pagination is not None: + + _query_params.append(('pagination', pagination)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if name is not None: + + _query_params.append(('name', name)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/devices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def update_device_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + devices_put: Annotated[Optional[DevicesPut], Field(description="The `device` resource definition.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Devices: + """Update a device + + Update an existing device. + + :param id: The UUID of the resource (required) + :type id: str + :param devices_put: The `device` resource definition. + :type devices_put: DevicesPut + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_device_by_id_serialize( + id=id, + devices_put=devices_put, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Devices", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_device_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + devices_put: Annotated[Optional[DevicesPut], Field(description="The `device` resource definition.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[Devices]: + """Update a device + + Update an existing device. + + :param id: The UUID of the resource (required) + :type id: str + :param devices_put: The `device` resource definition. + :type devices_put: DevicesPut + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_device_by_id_serialize( + id=id, + devices_put=devices_put, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Devices", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_device_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + devices_put: Annotated[Optional[DevicesPut], Field(description="The `device` resource definition.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 device + + Update an existing device. + + :param id: The UUID of the resource (required) + :type id: str + :param devices_put: The `device` resource definition. + :type devices_put: DevicesPut + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_device_by_id_serialize( + id=id, + devices_put=devices_put, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Devices", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + + def fetch_devices( + self, + name: str, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single devices object by name. + + This is a convenience method that uses server-side name filtering to retrieve + a specific object by its name. + + Args: + name: The name of the object to fetch + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_devices(name="my-object") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + # Build list parameters with server-side name filter + list_params = {'name': name, 'limit': 5000} + # Add any additional kwargs (excluding offset/limit/name which we handle separately) + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit', 'name']}) + + try: + response = self.list_devices(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Standard paginated response - verify exact name match + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name'): + if obj.name == name: + return obj + else: + return obj + + return None + + def _update_device_by_id_serialize( + self, + id, + devices_put, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if devices_put is not None: + _body_params = devices_put + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/devices/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/scm/config_setup/docs/Devices.md b/scm/config_setup/docs/Devices.md index d6f26619..e84cf699 100644 --- a/scm/config_setup/docs/Devices.md +++ b/scm/config_setup/docs/Devices.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **app_version** | **str** | | [optional] [readonly] **av_release_date** | **str** | | [optional] [readonly] **available_licensess** | [**List[DevicesAvailableLicensessInner]**](DevicesAvailableLicensessInner.md) | | [optional] [readonly] -**connected_since** | **datetime** | | [optional] [readonly] +**connected_since** | **str** | | [optional] [readonly] **description** | **str** | The description of the device | [optional] **dev_cert_detail** | **str** | | [optional] [readonly] **dev_cert_expiry_date** | **str** | | [optional] [readonly] diff --git a/scm/config_setup/docs/DevicesApi.md b/scm/config_setup/docs/DevicesApi.md new file mode 100644 index 00000000..303461b8 --- /dev/null +++ b/scm/config_setup/docs/DevicesApi.md @@ -0,0 +1,270 @@ +# scm.config_setup.DevicesApi + +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/setup/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_device_by_id**](DevicesApi.md#get_device_by_id) | **GET** /devices/{id} | Get a device +[**list_devices**](DevicesApi.md#list_devices) | **GET** /devices | List devices +[**update_device_by_id**](DevicesApi.md#update_device_by_id) | **PUT** /devices/{id} | Update a device + + +# **get_device_by_id** +> Devices get_device_by_id(id) + +Get a device + +Retrieve an existing device. + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.config_setup +from scm.config_setup.models.devices import Devices +from scm.config_setup.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/setup/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.config_setup.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/setup/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.config_setup.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.config_setup.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.config_setup.DevicesApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Get a device + api_response = api_instance.get_device_by_id(id) + print("The response of DevicesApi->get_device_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->get_device_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +[**Devices**](Devices.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_devices** +> DevicesListResponse list_devices(pagination=pagination, limit=limit, offset=offset, name=name) + +List devices + +Retrieve a list of devices. + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.config_setup +from scm.config_setup.models.devices_list_response import DevicesListResponse +from scm.config_setup.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/setup/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.config_setup.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/setup/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.config_setup.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.config_setup.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.config_setup.DevicesApi(api_client) + pagination = True # bool | The parameter to mention if the response should be paginated. By default, its set to false (optional) + limit = 56 # int | The maximum number of resources to return (optional) + offset = 56 # int | The offset into the list of resources returned (optional) + name = 'name_example' # str | The name of the resource (optional) + + try: + # List devices + api_response = api_instance.list_devices(pagination=pagination, limit=limit, offset=offset, name=name) + print("The response of DevicesApi->list_devices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->list_devices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pagination** | **bool**| The parameter to mention if the response should be paginated. By default, its set to false | [optional] + **limit** | **int**| The maximum number of resources to return | [optional] + **offset** | **int**| The offset into the list of resources returned | [optional] + **name** | **str**| The name of the resource | [optional] + +### Return type + +[**DevicesListResponse**](DevicesListResponse.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_device_by_id** +> Devices update_device_by_id(id, devices_put=devices_put) + +Update a device + +Update an existing device. + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.config_setup +from scm.config_setup.models.devices import Devices +from scm.config_setup.models.devices_put import DevicesPut +from scm.config_setup.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/setup/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.config_setup.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/setup/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.config_setup.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.config_setup.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.config_setup.DevicesApi(api_client) + id = 'id_example' # str | The UUID of the resource + devices_put = scm.config_setup.DevicesPut() # DevicesPut | The `device` resource definition. (optional) + + try: + # Update a device + api_response = api_instance.update_device_by_id(id, devices_put=devices_put) + print("The response of DevicesApi->update_device_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DevicesApi->update_device_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + **devices_put** | [**DevicesPut**](DevicesPut.md)| The `device` resource definition. | [optional] + +### Return type + +[**Devices**](Devices.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/config_setup/docs/DevicesListResponse.md b/scm/config_setup/docs/DevicesListResponse.md new file mode 100644 index 00000000..5a3ae800 --- /dev/null +++ b/scm/config_setup/docs/DevicesListResponse.md @@ -0,0 +1,32 @@ +# DevicesListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[Devices]**](Devices.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.config_setup.models.devices_list_response import DevicesListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DevicesListResponse from a JSON string +devices_list_response_instance = DevicesListResponse.from_json(json) +# print the JSON string representation of the object +print(DevicesListResponse.to_json()) + +# convert the object into a dict +devices_list_response_dict = devices_list_response_instance.to_dict() +# create an instance of DevicesListResponse from a dict +devices_list_response_from_dict = DevicesListResponse.from_dict(devices_list_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/scm/config_setup/models/__init__.py b/scm/config_setup/models/__init__.py index 17943f44..ae6c2862 100644 --- a/scm/config_setup/models/__init__.py +++ b/scm/config_setup/models/__init__.py @@ -23,6 +23,7 @@ from scm.config_setup.models.devices import Devices from scm.config_setup.models.devices_available_licensess_inner import DevicesAvailableLicensessInner from scm.config_setup.models.devices_installed_licenses_inner import DevicesInstalledLicensesInner +from scm.config_setup.models.devices_list_response import DevicesListResponse from scm.config_setup.models.devices_put import DevicesPut from scm.config_setup.models.error_detail_cause_info import ErrorDetailCauseInfo from scm.config_setup.models.folders import Folders diff --git a/scm/config_setup/models/devices.py b/scm/config_setup/models/devices.py index b4cc3bcc..40b7f63c 100644 --- a/scm/config_setup/models/devices.py +++ b/scm/config_setup/models/devices.py @@ -18,7 +18,6 @@ import re # noqa: F401 import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from scm.config_setup.models.devices_available_licensess_inner import DevicesAvailableLicensessInner @@ -35,7 +34,7 @@ class Devices(BaseModel): app_version: Optional[StrictStr] = None av_release_date: Optional[StrictStr] = None available_licensess: Optional[List[DevicesAvailableLicensessInner]] = None - connected_since: Optional[datetime] = None + connected_since: Optional[StrictStr] = None description: Optional[StrictStr] = Field(default=None, description="The description of the device") dev_cert_detail: Optional[StrictStr] = None dev_cert_expiry_date: Optional[StrictStr] = None diff --git a/scm/config_setup/models/devices_list_response.py b/scm/config_setup/models/devices_list_response.py new file mode 100644 index 00000000..4d4c3ea3 --- /dev/null +++ b/scm/config_setup/models/devices_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Configuration Setup + + These APIs are used to define how Strata Cloud Manager configurations are implemented. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.config_setup.models.devices import Devices +from typing import Optional, Set +from typing_extensions import Self + +class DevicesListResponse(BaseModel): + """ + DevicesListResponse + """ # noqa: E501 + data: List[Devices] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DevicesListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DevicesListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = Devices.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [Devices.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/config_setup/rest.py b/scm/config_setup/rest.py index 506126a8..5e236795 100644 --- a/scm/config_setup/rest.py +++ b/scm/config_setup/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/config_setup/tests/api_devices_test.py b/scm/config_setup/tests/api_devices_test.py new file mode 100644 index 00000000..bdd2d037 --- /dev/null +++ b/scm/config_setup/tests/api_devices_test.py @@ -0,0 +1,169 @@ + +import logging +import pytest +from scm import Scm +from scm.test_helpers import perform + +# Configure logging to see details during test execution (use pytest -s) +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + + +@pytest.fixture(scope="module") +def client(): + """ + Fixture to initialize the SCM client once for the module. + Assumes SCM_CLIENT_ID, SCM_CLIENT_SECRET, SCM_TSG_ID are set in env. + """ + try: + return Scm(log_level="DEBUG") + except Exception as e: + pytest.skip(f"Skipping tests due to client initialization failure: {e}") + + +@pytest.fixture(scope="module") +def devices_api(client): + """ + Fixture to return the Devices API instance. + """ + return client.config_setup.DevicesApi(client.config_setup.api_client) + + +def test_list_devices(devices_api): + """ + Test listing devices. + This is a read-only operation that retrieves the current list of devices. + Equivalent to Go: Test_config_setup_DevicesAPIService_List + """ + logger.info("\n[TEST] Listing devices") + + # List devices using perform helper + response = perform( + devices_api.list_devices_with_http_info, + response_type=object, + limit=200, + offset=0 + ) + + assert response is not None, "Response should not be None" + assert hasattr(response, 'data'), "Response should have 'data' attribute" + + devices = response.data + logger.info(f"Successfully retrieved {len(devices)} devices (limit: {response.limit}, offset: {response.offset}, total: {response.total})") + + # Log first few devices for debugging + for i, device in enumerate(devices[:3]): + logger.info(f" Device {i+1}: ID={device.id}, Name={device.name}") + + +def test_get_device_by_id(devices_api): + """ + Test retrieving a specific device by ID. + First lists devices to find a valid ID, then retrieves that specific device. + Equivalent to Go: Test_config_setup_DevicesAPIService_GetByID + """ + logger.info("\n[TEST] Getting device by ID") + + # First, list devices to get a valid device ID + list_response = perform( + devices_api.list_devices_with_http_info, + response_type=object, + limit=10, + offset=0 + ) + + assert list_response is not None + devices = list_response.data + + # Skip test if no devices exist + if len(devices) == 0: + pytest.skip("No devices found in the system, skipping GetByID test") + return + + # Get the first device's ID and name + first_device = devices[0] + device_id = first_device.id + device_name = first_device.name + logger.info(f"Using device from list: ID={device_id}, Name={device_name}") + + # Retrieve the specific device by ID + response = perform( + devices_api.get_device_by_id_with_http_info, + response_type=object, + id=device_id + ) + + assert response is not None, "Response should not be None" + assert response.id == device_id, f"Device ID should match: {device_id}" + assert response.name == device_name, f"Device name should match: {device_name}" + + logger.info(f"Successfully retrieved device: ID={response.id}, Name={response.name}") + + +def test_fetch_devices(devices_api): + """ + Test the fetch_devices convenience method. + First lists devices to get a valid name, then fetches that device by name. + Equivalent to Go: Test_config_setup_DevicesAPIService_FetchDevices + """ + logger.info("\n[TEST] Fetching device by name") + + # First, list devices to get a valid device name + list_response = perform( + devices_api.list_devices_with_http_info, + response_type=object, + limit=10, + offset=0 + ) + + assert list_response is not None + devices = list_response.data + + # Skip test if no devices exist + if len(devices) == 0: + pytest.skip("No devices found in the system, skipping FetchDevices test") + return + + # Get the first device's name and ID for verification + first_device = devices[0] + device_name = first_device.name + device_id = first_device.id + logger.info(f"Using device from list: ID={device_id}, Name={device_name}") + + # Test 1: Fetch existing device by name + response = perform( + devices_api.list_devices_with_http_info, + response_type=object, + name=device_name, + limit=5000 + ) + + assert response is not None, "Response should not be None" + assert hasattr(response, 'data'), "Response should have 'data' attribute" + + # Find the device in the response + fetched_device = None + for device in response.data: + if device.name == device_name: + fetched_device = device + break + + assert fetched_device is not None, f"Should find device with name: {device_name}" + assert fetched_device.id == device_id, f"Fetched device ID should match: {device_id}" + logger.info(f"[SUCCESS] Fetched device: ID={fetched_device.id}, Name={fetched_device.name}") + + # Test 2: Fetch non-existent device (should return 404 or empty data) + from scm.exceptions import NotFoundError + try: + response = perform( + devices_api.list_devices_with_http_info, + response_type=object, + name="non-existent-device-xyz-12345", + limit=5000 + ) + # If no exception, check for empty data + assert len(response.data) == 0, "Should return empty data for non-existent device" + logger.info("[SUCCESS] Correctly returned empty for non-existent device") + except NotFoundError: + # 404 is acceptable for non-existent device + logger.info("[SUCCESS] Correctly returned 404 for non-existent device") diff --git a/scm/deployment_services/api/bandwidth_allocations_api.py b/scm/deployment_services/api/bandwidth_allocations_api.py index 3bac59d8..e0b0a58f 100644 --- a/scm/deployment_services/api/bandwidth_allocations_api.py +++ b/scm/deployment_services/api/bandwidth_allocations_api.py @@ -1140,6 +1140,66 @@ def update_bandwidth_allocations_without_preload_content( return response_data.response + + def fetch_bandwidth_allocations( + self, + name: str, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single bandwidth_allocations object by name. + + This is a convenience method that uses client-side pagination to retrieve + a specific object by its name. It iterates through all pages of results + until the matching object is found. + + Args: + name: The name of the object to fetch + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_bandwidth_allocations(name="my-object") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + offset = 0 + limit = 5000 + + while True: + # Build list parameters with pagination + list_params = {'offset': offset, 'limit': limit} + # Add any additional kwargs + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit']}) + + try: + response = self.list_bandwidth_allocations(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Search for exact name match in response + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name') and obj.name == name: + return obj + + # Check if we've reached the end (less than limit returned) + if len(response.data) < limit: + break + else: + break + + offset += limit + + return None + def _update_bandwidth_allocations_serialize( self, bandwidth_allocations, diff --git a/scm/deployment_services/docs/ServiceConnections.md b/scm/deployment_services/docs/ServiceConnections.md index ae581fe6..d65e533d 100644 --- a/scm/deployment_services/docs/ServiceConnections.md +++ b/scm/deployment_services/docs/ServiceConnections.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **protocol** | [**ServiceConnectionsProtocol**](ServiceConnectionsProtocol.md) | | [optional] **qos** | [**ServiceConnectionsQos**](ServiceConnectionsQos.md) | | [optional] **region** | **str** | | +**region_tag** | **str** | | [optional] **secondary_ipsec_tunnel** | **str** | | [optional] **source_nat** | **bool** | | [optional] **subnets** | **List[str]** | | [optional] diff --git a/scm/deployment_services/docs/ServiceConnectionsBgpPeer.md b/scm/deployment_services/docs/ServiceConnectionsBgpPeer.md index 51cc9af2..6c79fa0c 100644 --- a/scm/deployment_services/docs/ServiceConnectionsBgpPeer.md +++ b/scm/deployment_services/docs/ServiceConnectionsBgpPeer.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **local_ipv6_address** | **str** | | [optional] **peer_ip_address** | **str** | | [optional] **peer_ipv6_address** | **str** | | [optional] +**same_as_primary** | **bool** | Same peer IP address for SC | [optional] **secret** | **str** | | [optional] ## Example diff --git a/scm/deployment_services/models/service_connections.py b/scm/deployment_services/models/service_connections.py index 700634c0..9d74f8b1 100644 --- a/scm/deployment_services/models/service_connections.py +++ b/scm/deployment_services/models/service_connections.py @@ -41,10 +41,11 @@ class ServiceConnections(BaseModel): protocol: Optional[ServiceConnectionsProtocol] = None qos: Optional[ServiceConnectionsQos] = None region: StrictStr + region_tag: Optional[StrictStr] = None secondary_ipsec_tunnel: Optional[StrictStr] = None source_nat: Optional[StrictBool] = None subnets: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["backup_SC", "bgp_peer", "id", "ipsec_tunnel", "name", "nat_pool", "no_export_community", "onboarding_type", "protocol", "qos", "region", "secondary_ipsec_tunnel", "source_nat", "subnets"] + __properties: ClassVar[List[str]] = ["backup_SC", "bgp_peer", "id", "ipsec_tunnel", "name", "nat_pool", "no_export_community", "onboarding_type", "protocol", "qos", "region", "region_tag", "secondary_ipsec_tunnel", "source_nat", "subnets"] @field_validator('no_export_community') def no_export_community_validate_enum(cls, value): @@ -139,6 +140,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "protocol": ServiceConnectionsProtocol.from_dict(obj["protocol"]) if obj.get("protocol") is not None else None, "qos": ServiceConnectionsQos.from_dict(obj["qos"]) if obj.get("qos") is not None else None, "region": obj.get("region"), + "region_tag": obj.get("region_tag"), "secondary_ipsec_tunnel": obj.get("secondary_ipsec_tunnel"), "source_nat": obj.get("source_nat"), "subnets": obj.get("subnets") diff --git a/scm/deployment_services/models/service_connections_bgp_peer.py b/scm/deployment_services/models/service_connections_bgp_peer.py index d993ebb5..0ee7ca11 100644 --- a/scm/deployment_services/models/service_connections_bgp_peer.py +++ b/scm/deployment_services/models/service_connections_bgp_peer.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, SecretStr, StrictStr +from pydantic import BaseModel, ConfigDict, Field, SecretStr, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -31,8 +31,9 @@ class ServiceConnectionsBgpPeer(BaseModel): local_ipv6_address: Optional[StrictStr] = None peer_ip_address: Optional[StrictStr] = None peer_ipv6_address: Optional[StrictStr] = None + same_as_primary: Optional[StrictBool] = Field(default=None, description="Same peer IP address for SC") secret: Optional[SecretStr] = None - __properties: ClassVar[List[str]] = ["local_ip_address", "local_ipv6_address", "peer_ip_address", "peer_ipv6_address", "secret"] + __properties: ClassVar[List[str]] = ["local_ip_address", "local_ipv6_address", "peer_ip_address", "peer_ipv6_address", "same_as_primary", "secret"] model_config = ConfigDict( populate_by_name=True, @@ -89,6 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "local_ipv6_address": obj.get("local_ipv6_address"), "peer_ip_address": obj.get("peer_ip_address"), "peer_ipv6_address": obj.get("peer_ipv6_address"), + "same_as_primary": obj.get("same_as_primary"), "secret": obj.get("secret") }) return _obj diff --git a/scm/deployment_services/rest.py b/scm/deployment_services/rest.py index bc8629d7..51b11713 100644 --- a/scm/deployment_services/rest.py +++ b/scm/deployment_services/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/deployment_services/tests/api_bandwidth_allocations_test.py b/scm/deployment_services/tests/api_bandwidth_allocations_test.py index 14ed2ee0..49f202ae 100644 --- a/scm/deployment_services/tests/api_bandwidth_allocations_test.py +++ b/scm/deployment_services/tests/api_bandwidth_allocations_test.py @@ -63,3 +63,34 @@ def test_list_bandwidth_allocations(bandwidth_allocations_api): response = bandwidth_allocations_api.list_bandwidth_allocations() assert response is not None logger.info(f"Listed Bandwidth Allocations successfully") + + +def test_fetch_bandwidth_allocations(bandwidth_allocations_api): + """ + Test fetch method for bandwidth allocations. + Uses client-side pagination to find an object by name. + """ + # First, list to find an existing allocation name + response = bandwidth_allocations_api.list_bandwidth_allocations() + if response is None or not hasattr(response, 'data') or not response.data: + pytest.skip("No bandwidth allocations found to test fetch") + + target = response.data[0] + target_name = target.name + logger.info(f"Testing fetch for: {target_name}") + + # Use fetch method (client-side pagination) + fetched = bandwidth_allocations_api.fetch_bandwidth_allocations(name=target_name) + + assert fetched is not None + assert fetched.name == target_name + logger.info(f"Successfully fetched bandwidth allocation: {fetched.name}") + + +def test_fetch_bandwidth_allocations_not_found(bandwidth_allocations_api): + """Test fetch returns None for non-existent allocation.""" + result = bandwidth_allocations_api.fetch_bandwidth_allocations( + name="non-existent-bandwidth-allocation-xyz123" + ) + assert result is None + logger.info("Correctly returned None for non-existent bandwidth allocation") diff --git a/scm/deployment_services/tests/api_service_connection_groups_test.py b/scm/deployment_services/tests/api_service_connection_groups_test.py index 31cbc378..aaa7b6d5 100644 --- a/scm/deployment_services/tests/api_service_connection_groups_test.py +++ b/scm/deployment_services/tests/api_service_connection_groups_test.py @@ -404,3 +404,29 @@ def test_delete_service_connection_group_by_id(service_connection_groups_api, se # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_service_connection_groups(service_connection_groups_api, clean_service_connection_group): + """ + Test fetching a single service connection group by name using the fetch convenience method. + Equivalent to Go: Test_deployment_services_ServiceConnectionGroupsAPIService_FetchServiceConnectionGroups + """ + # Fetch by exact name + fetched_obj = service_connection_groups_api.fetch_service_connection_groups( + name=clean_service_connection_group.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found group '{clean_service_connection_group.name}'" + assert fetched_obj.id == clean_service_connection_group.id + assert fetched_obj.name == clean_service_connection_group.name + logger.info(f"\n[SUCCESS] fetch_service_connection_groups found object: {fetched_obj.name}") + + # Test fetching non-existent group (should return None) + not_found = service_connection_groups_api.fetch_service_connection_groups( + name="non-existent-service-connection-group-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent group" + logger.info(f"\n[SUCCESS] fetch_service_connection_groups correctly returned None for non-existent group") diff --git a/scm/deployment_services/tests/api_service_connections_test.py b/scm/deployment_services/tests/api_service_connections_test.py index f129375f..073cd4f2 100644 --- a/scm/deployment_services/tests/api_service_connections_test.py +++ b/scm/deployment_services/tests/api_service_connections_test.py @@ -368,3 +368,29 @@ def test_delete_service_connection_by_id(service_connections_api, ipsec_tunnel_w # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_service_connections(service_connections_api, clean_service_connection): + """ + Test fetching a single service connection by name using the fetch convenience method. + Equivalent to Go: Test_deployment_services_ServiceConnectionsAPIService_FetchServiceConnections + """ + # Fetch by exact name + fetched_obj = service_connections_api.fetch_service_connections( + name=clean_service_connection.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found connection '{clean_service_connection.name}'" + assert fetched_obj.id == clean_service_connection.id + assert fetched_obj.name == clean_service_connection.name + logger.info(f"\n[SUCCESS] fetch_service_connections found object: {fetched_obj.name}") + + # Test fetching non-existent connection (should return None) + not_found = service_connections_api.fetch_service_connections( + name="non-existent-service-connection-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent connection" + logger.info(f"\n[SUCCESS] fetch_service_connections correctly returned None for non-existent connection") diff --git a/scm/device_settings/rest.py b/scm/device_settings/rest.py index 26758c28..284294de 100644 --- a/scm/device_settings/rest.py +++ b/scm/device_settings/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/identity_services/api/certificates_api.py b/scm/identity_services/api/certificates_api.py index 8fe7ad18..09c54b21 100644 --- a/scm/identity_services/api/certificates_api.py +++ b/scm/identity_services/api/certificates_api.py @@ -21,6 +21,7 @@ from typing import Optional from typing_extensions import Annotated from scm.identity_services.models.certificates_get import CertificatesGet +from scm.identity_services.models.certificates_import import CertificatesImport from scm.identity_services.models.certificates_list_response import CertificatesListResponse from scm.identity_services.models.certificates_post import CertificatesPost from scm.identity_services.models.export_certificate_payload import ExportCertificatePayload @@ -673,7 +674,7 @@ def export_certificate_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "ExportCertificateResponse", + '200': "ExportCertificateResponse", '400': "GenericError", '401': "GenericError", '403': "GenericError", @@ -749,7 +750,7 @@ def export_certificate_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "ExportCertificateResponse", + '200': "ExportCertificateResponse", '400': "GenericError", '401': "GenericError", '403': "GenericError", @@ -825,7 +826,7 @@ def export_certificate_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "ExportCertificateResponse", + '200': "ExportCertificateResponse", '400': "GenericError", '401': "GenericError", '403': "GenericError", @@ -920,9 +921,9 @@ def _export_certificate_by_id_serialize( @validate_call @with_error_handling - def get_certificates_by_id( + def import_certificates( self, - id: Annotated[StrictStr, Field(description="The UUID of the configuration resource")], + certificates_import: Annotated[Optional[CertificatesImport], Field(description="Import certificate payload")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -936,12 +937,12 @@ def get_certificates_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> CertificatesGet: - """Get a certificate + """Import a certificate - Get an existing certificate. + Import a certificate. - :param id: The UUID of the configuration resource (required) - :type id: str + :param certificates_import: Import certificate payload + :type certificates_import: CertificatesImport :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -964,8 +965,8 @@ def get_certificates_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._get_certificates_by_id_serialize( - id=id, + _param = self._import_certificates_serialize( + certificates_import=certificates_import, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -977,7 +978,6 @@ def get_certificates_by_id( '400': "GenericError", '401': "GenericError", '403': "GenericError", - '404': "GenericError", '409': "GenericError", } response_data = self.api_client.call_api( @@ -993,9 +993,9 @@ def get_certificates_by_id( @validate_call @with_error_handling - def get_certificates_by_id_with_http_info( + def import_certificates_with_http_info( self, - id: Annotated[StrictStr, Field(description="The UUID of the configuration resource")], + certificates_import: Annotated[Optional[CertificatesImport], Field(description="Import certificate payload")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1009,12 +1009,12 @@ def get_certificates_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[CertificatesGet]: - """Get a certificate + """Import a certificate - Get an existing certificate. + Import a certificate. - :param id: The UUID of the configuration resource (required) - :type id: str + :param certificates_import: Import certificate payload + :type certificates_import: CertificatesImport :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1037,8 +1037,8 @@ def get_certificates_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_certificates_by_id_serialize( - id=id, + _param = self._import_certificates_serialize( + certificates_import=certificates_import, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1050,7 +1050,6 @@ def get_certificates_by_id_with_http_info( '400': "GenericError", '401': "GenericError", '403': "GenericError", - '404': "GenericError", '409': "GenericError", } response_data = self.api_client.call_api( @@ -1066,9 +1065,9 @@ def get_certificates_by_id_with_http_info( @validate_call @with_error_handling - def get_certificates_by_id_without_preload_content( + def import_certificates_without_preload_content( self, - id: Annotated[StrictStr, Field(description="The UUID of the configuration resource")], + certificates_import: Annotated[Optional[CertificatesImport], Field(description="Import certificate payload")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1082,12 +1081,12 @@ def get_certificates_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get a certificate + """Import a certificate - Get an existing certificate. + Import a certificate. - :param id: The UUID of the configuration resource (required) - :type id: str + :param certificates_import: Import certificate payload + :type certificates_import: CertificatesImport :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1110,8 +1109,8 @@ def get_certificates_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_certificates_by_id_serialize( - id=id, + _param = self._import_certificates_serialize( + certificates_import=certificates_import, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1123,7 +1122,6 @@ def get_certificates_by_id_without_preload_content( '400': "GenericError", '401': "GenericError", '403': "GenericError", - '404': "GenericError", '409': "GenericError", } response_data = self.api_client.call_api( @@ -1133,9 +1131,9 @@ def get_certificates_by_id_without_preload_content( return response_data.response - def _get_certificates_by_id_serialize( + def _import_certificates_serialize( self, - id, + certificates_import, _request_auth, _content_type, _headers, @@ -1157,12 +1155,12 @@ def _get_certificates_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if id is not None: - _path_params['id'] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if certificates_import is not None: + _body_params = certificates_import # set the HTTP header `Accept` @@ -1173,6 +1171,19 @@ def _get_certificates_by_id_serialize( ] ) + # 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] = [ @@ -1180,8 +1191,8 @@ def _get_certificates_by_id_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/certificates/{id}', + method='POST', + resource_path='/certificates:import', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/scm/identity_services/docs/CertificatesApi.md b/scm/identity_services/docs/CertificatesApi.md index e5b49c87..12d711de 100644 --- a/scm/identity_services/docs/CertificatesApi.md +++ b/scm/identity_services/docs/CertificatesApi.md @@ -7,7 +7,7 @@ Method | HTTP request | Description [**create_certificates**](CertificatesApi.md#create_certificates) | **POST** /certificates | Generate a certificate [**delete_certificates_by_id**](CertificatesApi.md#delete_certificates_by_id) | **DELETE** /certificates/{id} | Delete a certificate [**export_certificate_by_id**](CertificatesApi.md#export_certificate_by_id) | **POST** /certificates/{id}:export | Export a certificate -[**get_certificates_by_id**](CertificatesApi.md#get_certificates_by_id) | **GET** /certificates/{id} | Get a certificate +[**import_certificates**](CertificatesApi.md#import_certificates) | **POST** /certificates:import | Import a certificate [**list_certificates**](CertificatesApi.md#list_certificates) | **GET** /certificates | List certificates @@ -253,7 +253,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**201** | OK | - | +**200** | OK | - | **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -262,12 +262,12 @@ 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_certificates_by_id** -> CertificatesGet get_certificates_by_id(id) +# **import_certificates** +> CertificatesGet import_certificates(certificates_import=certificates_import) -Get a certificate +Import a certificate -Get an existing certificate. +Import a certificate. ### Example @@ -276,6 +276,7 @@ Get an existing certificate. ```python import scm.identity_services from scm.identity_services.models.certificates_get import CertificatesGet +from scm.identity_services.models.certificates_import import CertificatesImport from scm.identity_services.rest import ApiException from pprint import pprint @@ -299,15 +300,15 @@ configuration = scm.identity_services.Configuration( with scm.identity_services.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = scm.identity_services.CertificatesApi(api_client) - id = '123e4567-e89b-12d3-a456-426655440000' # str | The UUID of the configuration resource + certificates_import = scm.identity_services.CertificatesImport() # CertificatesImport | Import certificate payload (optional) try: - # Get a certificate - api_response = api_instance.get_certificates_by_id(id) - print("The response of CertificatesApi->get_certificates_by_id:\n") + # Import a certificate + api_response = api_instance.import_certificates(certificates_import=certificates_import) + print("The response of CertificatesApi->import_certificates:\n") pprint(api_response) except Exception as e: - print("Exception when calling CertificatesApi->get_certificates_by_id: %s\n" % e) + print("Exception when calling CertificatesApi->import_certificates: %s\n" % e) ``` @@ -317,7 +318,7 @@ with scm.identity_services.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **str**| The UUID of the configuration resource | + **certificates_import** | [**CertificatesImport**](CertificatesImport.md)| Import certificate payload | [optional] ### Return type @@ -329,7 +330,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -340,7 +341,6 @@ Name | Type | Description | Notes **400** | Bad Request | - | **401** | Unauthorized | - | **403** | Forbidden | - | -**404** | Not Found | - | **409** | Conflict | - | **0** | General Errors | - | diff --git a/scm/identity_services/docs/CertificatesGet.md b/scm/identity_services/docs/CertificatesGet.md index 6af791d1..4fee90f1 100644 --- a/scm/identity_services/docs/CertificatesGet.md +++ b/scm/identity_services/docs/CertificatesGet.md @@ -16,8 +16,8 @@ Name | Type | Description | Notes **issuer** | **str** | Issuer | [optional] **issuer_hash** | **str** | Issue hash | [optional] **name** | **str** | The name of the certificate | [optional] -**not_valid_after** | **date** | Not valid after this date | [optional] -**not_valid_before** | **date** | Not valid before this date | [optional] +**not_valid_after** | **str** | Not valid after this date | [optional] +**not_valid_before** | **str** | Not valid before this date | [optional] **public_key** | **str** | Public key | [optional] **snippet** | **str** | The snippet in which the resource is defined | [optional] **subject** | **str** | Subject | [optional] diff --git a/scm/identity_services/docs/MfaServersMfaVendorTypeOktaAdaptiveV1.md b/scm/identity_services/docs/MfaServersMfaVendorTypeOktaAdaptiveV1.md index 895e180c..16c9a593 100644 --- a/scm/identity_services/docs/MfaServersMfaVendorTypeOktaAdaptiveV1.md +++ b/scm/identity_services/docs/MfaServersMfaVendorTypeOktaAdaptiveV1.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **okta_api_host** | **str** | Okta API hostname | **okta_baseuri** | **str** | | [default to '/api/v1'] **okta_org** | **str** | Okta organization | -**okta_timeout** | **int** | Okta timeout (seconds) | [default to 30] +**okta_timeout** | **str** | Okta timeout (seconds) | [default to '30'] **okta_token** | **str** | Okta API token | ## Example diff --git a/scm/identity_services/models/certificates_get.py b/scm/identity_services/models/certificates_get.py index 25eb2c8e..5f65af5c 100644 --- a/scm/identity_services/models/certificates_get.py +++ b/scm/identity_services/models/certificates_get.py @@ -18,7 +18,6 @@ import re # noqa: F401 import json -from datetime import date from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated @@ -40,8 +39,8 @@ class CertificatesGet(BaseModel): issuer: Optional[StrictStr] = Field(default=None, description="Issuer") issuer_hash: Optional[StrictStr] = Field(default=None, description="Issue hash") name: Optional[StrictStr] = Field(default=None, description="The name of the certificate") - not_valid_after: Optional[date] = Field(default=None, description="Not valid after this date") - not_valid_before: Optional[date] = Field(default=None, description="Not valid before this date") + not_valid_after: Optional[StrictStr] = Field(default=None, description="Not valid after this date") + not_valid_before: Optional[StrictStr] = Field(default=None, description="Not valid before this date") public_key: Optional[StrictStr] = Field(default=None, description="Public key") snippet: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="The snippet in which the resource is defined") subject: Optional[StrictStr] = Field(default=None, description="Subject") diff --git a/scm/identity_services/models/export_certificate_payload.py b/scm/identity_services/models/export_certificate_payload.py index acb571c5..8cb1f780 100644 --- a/scm/identity_services/models/export_certificate_payload.py +++ b/scm/identity_services/models/export_certificate_payload.py @@ -31,12 +31,9 @@ class ExportCertificatePayload(BaseModel): passphrase: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["format", "passphrase"] - @field_validator('passphrase') - def passphrase_validate_enum(cls, value): + @field_validator('format') + def format_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['pkcs12', 'pem', 'der', 'pkcs10']): raise ValueError("must be one of enum values ('pkcs12', 'pem', 'der', 'pkcs10')") return value diff --git a/scm/identity_services/models/mfa_servers_mfa_vendor_type_okta_adaptive_v1.py b/scm/identity_services/models/mfa_servers_mfa_vendor_type_okta_adaptive_v1.py index 5e9bfdf3..735e0243 100644 --- a/scm/identity_services/models/mfa_servers_mfa_vendor_type_okta_adaptive_v1.py +++ b/scm/identity_services/models/mfa_servers_mfa_vendor_type_okta_adaptive_v1.py @@ -31,7 +31,7 @@ class MfaServersMfaVendorTypeOktaAdaptiveV1(BaseModel): okta_api_host: Annotated[str, Field(min_length=10, strict=True)] = Field(description="Okta API hostname") okta_baseuri: Annotated[str, Field(min_length=2, strict=True)] okta_org: StrictStr = Field(description="Okta organization") - okta_timeout: Annotated[int, Field(le=600, strict=True, ge=5)] = Field(description="Okta timeout (seconds)") + okta_timeout: StrictStr = Field(description="Okta timeout (seconds)") okta_token: Annotated[str, Field(min_length=8, strict=True)] = Field(description="Okta API token") __properties: ClassVar[List[str]] = ["okta_api_host", "okta_baseuri", "okta_org", "okta_timeout", "okta_token"] @@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "okta_api_host": obj.get("okta_api_host"), "okta_baseuri": obj.get("okta_baseuri") if obj.get("okta_baseuri") is not None else '/api/v1', "okta_org": obj.get("okta_org"), - "okta_timeout": obj.get("okta_timeout") if obj.get("okta_timeout") is not None else 30, + "okta_timeout": obj.get("okta_timeout") if obj.get("okta_timeout") is not None else '30', "okta_token": obj.get("okta_token") }) return _obj diff --git a/scm/identity_services/rest.py b/scm/identity_services/rest.py index 55263136..af3c5477 100644 --- a/scm/identity_services/rest.py +++ b/scm/identity_services/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/identity_services/tests/api_authentication_rules_test.py b/scm/identity_services/tests/api_authentication_rules_test.py index 49b5ac8b..f9e46b6d 100644 --- a/scm/identity_services/tests/api_authentication_rules_test.py +++ b/scm/identity_services/tests/api_authentication_rules_test.py @@ -231,3 +231,31 @@ def test_delete_auth_rule_by_id(auth_rules_api, test_auth_profile): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_authentication_rules(auth_rules_api, clean_auth_rule): + """ + Test fetching a single authentication rule by name using the fetch convenience method. + Equivalent to Go: Test_identity_services_AuthenticationRulesAPIService_FetchAuthenticationRules + """ + # Fetch by exact name (position is required for rules APIs) + fetched_obj = auth_rules_api.fetch_authentication_rules( + name=clean_auth_rule.name, + folder=TARGET_FOLDER, + position="pre" + ) + + # Verify + assert fetched_obj is not None, f"Should have found rule '{clean_auth_rule.name}'" + assert fetched_obj.id == clean_auth_rule.id + assert fetched_obj.name == clean_auth_rule.name + logger.info(f"\n[SUCCESS] fetch_authentication_rules found object: {fetched_obj.name}") + + # Test fetching non-existent rule (should return None) + not_found = auth_rules_api.fetch_authentication_rules( + name="non-existent-auth-rule-xyz-12345", + folder=TARGET_FOLDER, + position="pre" + ) + assert not_found is None, "Should return None for non-existent rule" + logger.info(f"\n[SUCCESS] fetch_authentication_rules correctly returned None for non-existent rule") diff --git a/scm/identity_services/tests/api_certificates_test.py b/scm/identity_services/tests/api_certificates_test.py index 9d0f9783..9d8ec53c 100644 --- a/scm/identity_services/tests/api_certificates_test.py +++ b/scm/identity_services/tests/api_certificates_test.py @@ -1,7 +1,14 @@ import logging +import base64 +import uuid import pytest from scm import Scm +from scm.identity_services.models.certificates_post import CertificatesPost +from scm.identity_services.models.certificates_post_algorithm import CertificatesPostAlgorithm +from scm.identity_services.models.certificates_import import CertificatesImport +from scm.identity_services.models.export_certificate_payload import ExportCertificatePayload +from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) @@ -11,6 +18,7 @@ @pytest.fixture(scope="module") def client(): + """Fixture to initialize the SCM client once for the module.""" try: return Scm(log_level="DEBUG") except Exception as e: @@ -19,14 +27,329 @@ def client(): @pytest.fixture(scope="module") def certificates_api(client): + """Fixture to return the Certificates API instance.""" return client.identity_services.CertificatesApi(client.identity_services.api_client) -def test_fetch_certificates(certificates_api): - """Test fetching a non-existent Certificate returns None.""" +def test_list_certificates(certificates_api): + """Test listing certificates.""" + response = perform( + certificates_api.list_certificates, + folder=TARGET_FOLDER, + limit=100 + ) + + assert response is not None + assert hasattr(response, 'data') + logger.info(f"Retrieved {len(response.data)} certificates") + + # Log first few certificates + for i, cert in enumerate(response.data[:5]): + logger.info(f" Certificate: {cert.name} (ID: {cert.id})") + + logger.info(f"[SUCCESS] list_certificates returned {len(response.data)} certificates") + + +def test_fetch_certificates_not_found(certificates_api): + """Test fetching a non-existent certificate returns None.""" result = certificates_api.fetch_certificates( name="non-existent-cert-xyz-12345", folder=TARGET_FOLDER, ) assert result is None, "Should return None for non-existent certificate" - logger.info("fetch_certificates correctly returned None for non-existent object") + logger.info("[SUCCESS] fetch_certificates correctly returned None for non-existent object") + + +def test_fetch_certificates_existing(certificates_api): + """Test fetching an existing certificate by name.""" + # First, list certificates to get a name to fetch + response = perform( + certificates_api.list_certificates, + folder=TARGET_FOLDER, + limit=10 + ) + + if not response.data or len(response.data) == 0: + pytest.skip("No certificates available to test fetch_existing - skipping") + return + + # Fetch the first certificate by name + cert_to_fetch = response.data[0] + cert_name = cert_to_fetch.name + + logger.info(f"Attempting to fetch Certificate with name: {cert_name}") + fetched_cert = certificates_api.fetch_certificates( + name=cert_name, + folder=TARGET_FOLDER, + ) + + assert fetched_cert is not None, "Fetched certificate should not be None" + assert fetched_cert.name == cert_name, "Fetched certificate name should match" + assert fetched_cert.id == cert_to_fetch.id, "Fetched certificate ID should match" + logger.info(f"[SUCCESS] fetch_certificates found certificate: {fetched_cert.name} (ID: {fetched_cert.id})") + + +def test_create_certificate(certificates_api): + """Test creating a certificate.""" + cert_name = f"test-cert-create-{uuid.uuid4().hex[:6]}" + + # Create algorithm with RSA 2048 bits + algorithm = CertificatesPostAlgorithm( + rsa_number_of_bits=2048.0 + ) + + # Create the certificate payload + cert = CertificatesPost( + algorithm=algorithm, + certificate_name=cert_name, + common_name=f"{cert_name}.example.com", + digest="sha256", + signed_by="Root CA", + folder=TARGET_FOLDER, + ) + + logger.info(f"Attempting to create Certificate with name: {cert_name}") + created_cert = perform( + certificates_api.create_certificates, + certificates_post=cert + ) + + assert created_cert is not None, "Response should not be None" + assert created_cert.id is not None, "Created certificate should have an ID" + assert created_cert.name == cert_name, "Created certificate name should match" + + created_cert_id = created_cert.id + logger.info(f"Successfully created Certificate: {cert_name} with ID: {created_cert_id}") + + # Cleanup: Delete the created certificate + try: + perform( + certificates_api.delete_certificates_by_id, + id=created_cert_id + ) + logger.info(f"Cleaned up Certificate with ID: {created_cert_id}") + except Exception as e: + logger.warning(f"Cleanup failed: {e}") + + logger.info(f"[SUCCESS] create_certificates created certificate: {cert_name}") + + +def test_delete_certificate(certificates_api): + """Test deleting a certificate.""" + # First, create a certificate to delete + cert_name = f"test-cert-delete-{uuid.uuid4().hex[:6]}" + + algorithm = CertificatesPostAlgorithm( + rsa_number_of_bits=2048.0 + ) + + cert = CertificatesPost( + algorithm=algorithm, + certificate_name=cert_name, + common_name=f"{cert_name}.example.com", + digest="sha256", + signed_by="Root CA", + folder=TARGET_FOLDER, + ) + + logger.info(f"Creating Certificate for delete test with name: {cert_name}") + created_cert = perform( + certificates_api.create_certificates, + certificates_post=cert + ) + + assert created_cert is not None, "Create response should not be None" + created_cert_id = created_cert.id + assert created_cert_id is not None, "Created certificate ID should not be empty" + logger.info(f"Created Certificate for Delete test with ID: {created_cert_id}") + + # Test Delete by ID operation + logger.info(f"Attempting to delete Certificate with ID: {created_cert_id}") + perform( + certificates_api.delete_certificates_by_id, + id=created_cert_id + ) + logger.info(f"[SUCCESS] delete_certificates_by_id deleted certificate: {created_cert_id}") + + # Verify the certificate no longer exists + fetched_cert = certificates_api.fetch_certificates( + name=cert_name, + folder=TARGET_FOLDER, + ) + assert fetched_cert is None, "Certificate should not exist after deletion" + logger.info("[SUCCESS] Verified certificate no longer exists after deletion") + + +def test_export_certificate(certificates_api): + """Test exporting a certificate.""" + # First, create a certificate to export + cert_name = f"test-cert-export-{uuid.uuid4().hex[:6]}" + + algorithm = CertificatesPostAlgorithm( + rsa_number_of_bits=2048.0 + ) + + cert = CertificatesPost( + algorithm=algorithm, + certificate_name=cert_name, + common_name=f"{cert_name}.example.com", + digest="sha256", + signed_by="Root CA", + folder=TARGET_FOLDER, + ) + + logger.info(f"Creating Certificate for export test with name: {cert_name}") + created_cert = perform( + certificates_api.create_certificates, + certificates_post=cert + ) + + assert created_cert is not None, "Create response should not be None" + created_cert_id = created_cert.id + logger.info(f"Created Certificate for Export test with ID: {created_cert_id}") + + try: + # Test Export operation + logger.info(f"Attempting to export Certificate with ID: {created_cert_id}") + export_payload = ExportCertificatePayload( + format="pem", + passphrase="Test@Passphrase123" + ) + export_res = perform( + certificates_api.export_certificate_by_id, + id=created_cert_id, + export_certificate_payload=export_payload + ) + + assert export_res is not None, "Export response should not be None" + assert export_res.certificate is not None, "Exported certificate data should not be None" + assert "-----BEGIN CERTIFICATE-----" in export_res.certificate, "Exported certificate should be in PEM format" + logger.info(f"[SUCCESS] export_certificate_by_id exported certificate: {created_cert_id}") + finally: + # Cleanup + logger.info(f"Cleaning up Certificate with ID: {created_cert_id}") + try: + perform( + certificates_api.delete_certificates_by_id, + id=created_cert_id + ) + except Exception as e: + logger.warning(f"Cleanup failed: {e}") + + +def test_import_certificate(certificates_api): + """Test importing a certificate.""" + # Step 1: Create a certificate to export (so we have valid PEM content) + cert_name = f"test-cert-for-import-{uuid.uuid4().hex[:6]}" + + algorithm = CertificatesPostAlgorithm( + rsa_number_of_bits=2048.0 + ) + + cert = CertificatesPost( + algorithm=algorithm, + certificate_name=cert_name, + common_name=f"{cert_name}.example.com", + digest="sha256", + signed_by="Root CA", + folder=TARGET_FOLDER, + ) + + logger.info(f"Creating source certificate for import test: {cert_name}") + created_cert = perform( + certificates_api.create_certificates, + certificates_post=cert + ) + + assert created_cert is not None, "Create response should not be None" + source_cert_id = created_cert.id + logger.info(f"Created source certificate with ID: {source_cert_id}") + + imported_cert_name = None + try: + # Step 2: Export the certificate to get the PEM content + export_payload = ExportCertificatePayload( + format="pem", + passphrase="Test@Passphrase123" + ) + export_res = perform( + certificates_api.export_certificate_by_id, + id=source_cert_id, + export_certificate_payload=export_payload + ) + + assert export_res is not None, "Export response should not be None" + assert export_res.certificate is not None, "Exported certificate should not be None" + + exported_pem = export_res.certificate + logger.info(f"Exported certificate PEM (length: {len(exported_pem)} bytes)") + + # Step 3: Parse the exported PEM to separate certificate and key + cert_start = exported_pem.find("-----BEGIN CERTIFICATE-----") + cert_end = exported_pem.find("-----END CERTIFICATE-----") + if cert_start >= 0 and cert_end > cert_start: + cert_pem = exported_pem[cert_start:cert_end + len("-----END CERTIFICATE-----")] + else: + pytest.fail("Failed to extract certificate from exported PEM") + + key_start = exported_pem.find("-----BEGIN ENCRYPTED PRIVATE KEY-----") + key_end = exported_pem.find("-----END ENCRYPTED PRIVATE KEY-----") + if key_start >= 0 and key_end > key_start: + key_pem = exported_pem[key_start:key_end + len("-----END ENCRYPTED PRIVATE KEY-----")] + else: + pytest.fail("Failed to extract private key from exported PEM") + + logger.info(f"Extracted certificate ({len(cert_pem)} bytes) and key ({len(key_pem)} bytes)") + + # Base64 encode the certificate and key for import + cert_base64 = base64.b64encode(cert_pem.encode()).decode() + key_base64 = base64.b64encode(key_pem.encode()).decode() + + # Step 4: Import the certificate with a new name + imported_cert_name = f"test-cert-imported-{uuid.uuid4().hex[:6]}" + + import_payload = CertificatesImport( + name=imported_cert_name, + certificate_file=cert_base64, + format="pem", + folder=TARGET_FOLDER, + key_file=key_base64, + passphrase="Test@Passphrase123", + ) + + logger.info(f"Attempting to import certificate with name: {imported_cert_name}") + import_res = perform( + certificates_api.import_certificates, + certificates_import=import_payload + ) + + assert import_res is not None, "Import response should not be None" + assert import_res.name == imported_cert_name, "Imported certificate name should match" + logger.info(f"[SUCCESS] import_certificates imported certificate: {imported_cert_name}") + + finally: + # Cleanup source certificate + logger.info(f"Cleaning up source certificate with ID: {source_cert_id}") + try: + perform( + certificates_api.delete_certificates_by_id, + id=source_cert_id + ) + except Exception as e: + logger.warning(f"Source cleanup failed: {e}") + + # Cleanup imported certificate + if imported_cert_name: + fetched_cert = certificates_api.fetch_certificates( + name=imported_cert_name, + folder=TARGET_FOLDER, + ) + if fetched_cert: + logger.info(f"Cleaning up imported certificate with ID: {fetched_cert.id}") + try: + perform( + certificates_api.delete_certificates_by_id, + id=fetched_cert.id + ) + except Exception as e: + logger.warning(f"Imported cert cleanup failed: {e}") diff --git a/scm/mobile_agent/__init__.py b/scm/mobile_agent/__init__.py new file mode 100644 index 00000000..07981280 --- /dev/null +++ b/scm/mobile_agent/__init__.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +# flake8: noqa + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# import apis into sdk package +from scm.mobile_agent.api.destinations_api import DestinationsApi +from scm.mobile_agent.api.forwarding_profiles_api import ForwardingProfilesApi +from scm.mobile_agent.api.regional_and_custom_proxies_api import RegionalAndCustomProxiesApi +from scm.mobile_agent.api.source_applications_api import SourceApplicationsApi +from scm.mobile_agent.api.user_locations_api import UserLocationsApi + +# import ApiClient +from scm.mobile_agent.api_response import ApiResponse +from scm.mobile_agent.api_client import ApiClient +from scm.mobile_agent.configuration import Configuration +from scm.mobile_agent.exceptions import OpenApiException +from scm.mobile_agent.exceptions import ApiTypeError +from scm.mobile_agent.exceptions import ApiValueError +from scm.mobile_agent.exceptions import ApiKeyError +from scm.mobile_agent.exceptions import ApiAttributeError +from scm.mobile_agent.exceptions import ApiException + +# import models into sdk package +from scm.mobile_agent.models.block_rule_basic import BlockRuleBasic +from scm.mobile_agent.models.block_rule_basic_allow_tcp import BlockRuleBasicAllowTcp +from scm.mobile_agent.models.block_rule_basic_allow_udp import BlockRuleBasicAllowUdp +from scm.mobile_agent.models.block_rule_ztna import BlockRuleZtna +from scm.mobile_agent.models.error_detail_cause_info import ErrorDetailCauseInfo +from scm.mobile_agent.models.forwarding_profile_destination_fqdn_entry import ForwardingProfileDestinationFqdnEntry +from scm.mobile_agent.models.forwarding_profile_destination_ip_entry import ForwardingProfileDestinationIpEntry +from scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy import ForwardingProfileGlobalProtectProxy +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy_global_protect_proxy import ForwardingProfileGlobalProtectProxyGlobalProtectProxy +from scm.mobile_agent.models.forwarding_profile_pac_file import ForwardingProfilePacFile +from scm.mobile_agent.models.forwarding_profile_pac_file_pac_file import ForwardingProfilePacFilePacFile +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner import ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner import ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy1 import ForwardingProfileRegionalAndCustomProxiesProxy1 +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy2 import ForwardingProfileRegionalAndCustomProxiesProxy2 +from scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from scm.mobile_agent.models.forwarding_profile_user_locations_internal_host_detection import ForwardingProfileUserLocationsInternalHostDetection +from scm.mobile_agent.models.forwarding_profile_ztna_agent import ForwardingProfileZtnaAgent +from scm.mobile_agent.models.forwarding_profile_ztna_agent_ztna_agent import ForwardingProfileZtnaAgentZtnaAgent +from scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from scm.mobile_agent.models.forwarding_profiles_type import ForwardingProfilesType +from scm.mobile_agent.models.forwarding_rule_basic import ForwardingRuleBasic +from scm.mobile_agent.models.forwarding_rule_ztna import ForwardingRuleZtna +from scm.mobile_agent.models.generic_error import GenericError +from scm.mobile_agent.models.global_protect_destinations_list_response import GlobalProtectDestinationsListResponse +from scm.mobile_agent.models.global_protect_forwarding_profiles_list_response import GlobalProtectForwardingProfilesListResponse +from scm.mobile_agent.models.global_protect_regional_and_custom_proxies_list_response import GlobalProtectRegionalAndCustomProxiesListResponse +from scm.mobile_agent.models.global_protect_source_applications_list_response import GlobalProtectSourceApplicationsListResponse +from scm.mobile_agent.models.global_protect_user_locations_list_response import GlobalProtectUserLocationsListResponse diff --git a/scm/mobile_agent/api/__init__.py b/scm/mobile_agent/api/__init__.py new file mode 100644 index 00000000..496370f7 --- /dev/null +++ b/scm/mobile_agent/api/__init__.py @@ -0,0 +1,9 @@ +# flake8: noqa + +# import apis into api package +from scm.mobile_agent.api.destinations_api import DestinationsApi +from scm.mobile_agent.api.forwarding_profiles_api import ForwardingProfilesApi +from scm.mobile_agent.api.regional_and_custom_proxies_api import RegionalAndCustomProxiesApi +from scm.mobile_agent.api.source_applications_api import SourceApplicationsApi +from scm.mobile_agent.api.user_locations_api import UserLocationsApi + diff --git a/scm/mobile_agent/api/destinations_api.py b/scm/mobile_agent/api/destinations_api.py new file mode 100644 index 00000000..56b15b34 --- /dev/null +++ b/scm/mobile_agent/api/destinations_api.py @@ -0,0 +1,1602 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + 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 scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from scm.mobile_agent.models.global_protect_destinations_list_response import GlobalProtectDestinationsListResponse + +from scm.mobile_agent.api_client import ApiClient, RequestSerialized +from scm.mobile_agent.api_response import ApiResponse +from scm.mobile_agent.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class DestinationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_global_protect_destination( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_destinations: Annotated[Optional[ForwardingProfileDestinations], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileDestinations: + """Create a GlobalProtect destination + + Create a new GlobalProtect destination + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_destinations: Created + :type forwarding_profile_destinations: ForwardingProfileDestinations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destination_serialize( + folder=folder, + forwarding_profile_destinations=forwarding_profile_destinations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_destination_with_http_info( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_destinations: Annotated[Optional[ForwardingProfileDestinations], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileDestinations]: + """Create a GlobalProtect destination + + Create a new GlobalProtect destination + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_destinations: Created + :type forwarding_profile_destinations: ForwardingProfileDestinations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destination_serialize( + folder=folder, + forwarding_profile_destinations=forwarding_profile_destinations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_destination_without_preload_content( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_destinations: Annotated[Optional[ForwardingProfileDestinations], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect destination + + Create a new GlobalProtect destination + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_destinations: Created + :type forwarding_profile_destinations: ForwardingProfileDestinations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destination_serialize( + folder=folder, + forwarding_profile_destinations=forwarding_profile_destinations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_global_protect_destination_serialize( + self, + folder, + forwarding_profile_destinations, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_destinations is not None: + _body_params = forwarding_profile_destinations + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/forwarding-profile-destinations', + 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 + @with_error_handling + def delete_global_protect_destination( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect destination + + Delete a GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_destination_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_destination_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect destination + + Delete a GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_destination_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_destination_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect destination + + Delete a GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_destination_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_global_protect_destination_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/forwarding-profile-destinations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def get_global_protect_destination_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileDestinations: + """Get a GlobalProtect destination + + Retrieve an existing GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_destination_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_destination_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileDestinations]: + """Get a GlobalProtect destination + + Retrieve an existing GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_destination_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_destination_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect destination + + Retrieve an existing GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_destination_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_global_protect_destination_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-destinations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_global_protect_destinations( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GlobalProtectDestinationsListResponse: + """List GlobalProtect destinations + + Retrieve a list of GlobalProtect destinations + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destinations_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectDestinationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_destinations_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[GlobalProtectDestinationsListResponse]: + """List GlobalProtect destinations + + Retrieve a list of GlobalProtect destinations + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destinations_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectDestinationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_destinations_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect destinations + + Retrieve a list of GlobalProtect destinations + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destinations_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectDestinationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_global_protect_destinations_serialize( + self, + name, + limit, + offset, + folder, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-destinations', + 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 + @with_error_handling + def update_global_protect_destination_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_destinations: Annotated[Optional[ForwardingProfileDestinations], Field(description="The destination resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileDestinations: + """Update a GlobalProtect destination + + Update an existing GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_destinations: The destination resource definition + :type forwarding_profile_destinations: ForwardingProfileDestinations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destination_by_id_serialize( + id=id, + forwarding_profile_destinations=forwarding_profile_destinations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_destination_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_destinations: Annotated[Optional[ForwardingProfileDestinations], Field(description="The destination resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileDestinations]: + """Update a GlobalProtect destination + + Update an existing GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_destinations: The destination resource definition + :type forwarding_profile_destinations: ForwardingProfileDestinations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destination_by_id_serialize( + id=id, + forwarding_profile_destinations=forwarding_profile_destinations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_destination_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_destinations: Annotated[Optional[ForwardingProfileDestinations], Field(description="The destination resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect destination + + Update an existing GlobalProtect destination + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_destinations: The destination resource definition + :type forwarding_profile_destinations: ForwardingProfileDestinations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_destination_by_id_serialize( + id=id, + forwarding_profile_destinations=forwarding_profile_destinations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileDestinations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + + def fetch_destinations( + self, + name: str, + folder: Optional[str] = None, + snippet: Optional[str] = None, + device: Optional[str] = None, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single destinations object by name. + + This is a convenience method that uses server-side name filtering to retrieve + a specific object by its name within a container (folder, snippet, or device). + + Args: + name: The name of the object to fetch + folder: The folder in which the resource is defined + snippet: The snippet in which the resource is defined + device: The device in which the resource is defined + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_destinations(name="my-object", folder="Texas") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + # Build list parameters with server-side name filter + list_params = {'name': name, 'limit': 5000} + if folder is not None: + list_params['folder'] = folder + if snippet is not None: + list_params['snippet'] = snippet + if device is not None: + list_params['device'] = device + # Add any additional kwargs (excluding offset/limit/name which we handle separately) + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit', 'name']}) + + try: + response = self.list_global_protect_destinations(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Standard paginated response - verify exact name match + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name'): + if obj.name == name: + return obj + else: + return obj + + return None + + def _update_global_protect_destination_by_id_serialize( + self, + id, + forwarding_profile_destinations, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_destinations is not None: + _body_params = forwarding_profile_destinations + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/forwarding-profile-destinations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/scm/mobile_agent/api/forwarding_profiles_api.py b/scm/mobile_agent/api/forwarding_profiles_api.py new file mode 100644 index 00000000..ece120b7 --- /dev/null +++ b/scm/mobile_agent/api/forwarding_profiles_api.py @@ -0,0 +1,1602 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + 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 scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from scm.mobile_agent.models.global_protect_forwarding_profiles_list_response import GlobalProtectForwardingProfilesListResponse + +from scm.mobile_agent.api_client import ApiClient, RequestSerialized +from scm.mobile_agent.api_response import ApiResponse +from scm.mobile_agent.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class ForwardingProfilesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_global_protect_forwarding_profile( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profiles: Annotated[Optional[ForwardingProfiles], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfiles: + """Create a GlobalProtect forwarding profile + + Create a new GlobalProtect forwarding profile + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profiles: Created + :type forwarding_profiles: ForwardingProfiles + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profile_serialize( + folder=folder, + forwarding_profiles=forwarding_profiles, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_forwarding_profile_with_http_info( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profiles: Annotated[Optional[ForwardingProfiles], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfiles]: + """Create a GlobalProtect forwarding profile + + Create a new GlobalProtect forwarding profile + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profiles: Created + :type forwarding_profiles: ForwardingProfiles + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profile_serialize( + folder=folder, + forwarding_profiles=forwarding_profiles, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_forwarding_profile_without_preload_content( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profiles: Annotated[Optional[ForwardingProfiles], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect forwarding profile + + Create a new GlobalProtect forwarding profile + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profiles: Created + :type forwarding_profiles: ForwardingProfiles + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profile_serialize( + folder=folder, + forwarding_profiles=forwarding_profiles, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_global_protect_forwarding_profile_serialize( + self, + folder, + forwarding_profiles, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profiles is not None: + _body_params = forwarding_profiles + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/forwarding-profiles', + 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 + @with_error_handling + def delete_global_protect_forwarding_profile( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect forwarding profile + + Delete a GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_forwarding_profile_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_forwarding_profile_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect forwarding profile + + Delete a GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_forwarding_profile_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_forwarding_profile_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect forwarding profile + + Delete a GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_forwarding_profile_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_global_protect_forwarding_profile_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/forwarding-profiles/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def get_global_protect_forwarding_profile_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfiles: + """Get a GlobalProtect forwarding profile + + Retrieve an existing GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_forwarding_profile_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_forwarding_profile_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfiles]: + """Get a GlobalProtect forwarding profile + + Retrieve an existing GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_forwarding_profile_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_forwarding_profile_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect forwarding profile + + Retrieve an existing GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_forwarding_profile_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_global_protect_forwarding_profile_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profiles/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_global_protect_forwarding_profiles( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GlobalProtectForwardingProfilesListResponse: + """List GlobalProtect forwarding profiles + + Retrieve a list of GlobalProtect forwarding profiles + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profiles_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectForwardingProfilesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_forwarding_profiles_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[GlobalProtectForwardingProfilesListResponse]: + """List GlobalProtect forwarding profiles + + Retrieve a list of GlobalProtect forwarding profiles + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profiles_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectForwardingProfilesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_forwarding_profiles_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect forwarding profiles + + Retrieve a list of GlobalProtect forwarding profiles + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profiles_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectForwardingProfilesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_global_protect_forwarding_profiles_serialize( + self, + name, + limit, + offset, + folder, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profiles', + 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 + @with_error_handling + def update_global_protect_forwarding_profile_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profiles: Annotated[Optional[ForwardingProfiles], Field(description="The forwarding profile resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfiles: + """Update a GlobalProtect forwarding profile + + Update an existing GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profiles: The forwarding profile resource definition + :type forwarding_profiles: ForwardingProfiles + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profile_by_id_serialize( + id=id, + forwarding_profiles=forwarding_profiles, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_forwarding_profile_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profiles: Annotated[Optional[ForwardingProfiles], Field(description="The forwarding profile resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfiles]: + """Update a GlobalProtect forwarding profile + + Update an existing GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profiles: The forwarding profile resource definition + :type forwarding_profiles: ForwardingProfiles + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profile_by_id_serialize( + id=id, + forwarding_profiles=forwarding_profiles, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_forwarding_profile_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profiles: Annotated[Optional[ForwardingProfiles], Field(description="The forwarding profile resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect forwarding profile + + Update an existing GlobalProtect forwarding profile + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profiles: The forwarding profile resource definition + :type forwarding_profiles: ForwardingProfiles + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_forwarding_profile_by_id_serialize( + id=id, + forwarding_profiles=forwarding_profiles, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfiles", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + + def fetch_forwarding_profiles( + self, + name: str, + folder: Optional[str] = None, + snippet: Optional[str] = None, + device: Optional[str] = None, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single forwarding_profiles object by name. + + This is a convenience method that uses server-side name filtering to retrieve + a specific object by its name within a container (folder, snippet, or device). + + Args: + name: The name of the object to fetch + folder: The folder in which the resource is defined + snippet: The snippet in which the resource is defined + device: The device in which the resource is defined + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_forwarding_profiles(name="my-object", folder="Texas") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + # Build list parameters with server-side name filter + list_params = {'name': name, 'limit': 5000} + if folder is not None: + list_params['folder'] = folder + if snippet is not None: + list_params['snippet'] = snippet + if device is not None: + list_params['device'] = device + # Add any additional kwargs (excluding offset/limit/name which we handle separately) + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit', 'name']}) + + try: + response = self.list_global_protect_forwarding_profiles(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Standard paginated response - verify exact name match + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name'): + if obj.name == name: + return obj + else: + return obj + + return None + + def _update_global_protect_forwarding_profile_by_id_serialize( + self, + id, + forwarding_profiles, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profiles is not None: + _body_params = forwarding_profiles + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/forwarding-profiles/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/scm/mobile_agent/api/regional_and_custom_proxies_api.py b/scm/mobile_agent/api/regional_and_custom_proxies_api.py new file mode 100644 index 00000000..72746153 --- /dev/null +++ b/scm/mobile_agent/api/regional_and_custom_proxies_api.py @@ -0,0 +1,1602 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + 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 scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from scm.mobile_agent.models.global_protect_regional_and_custom_proxies_list_response import GlobalProtectRegionalAndCustomProxiesListResponse + +from scm.mobile_agent.api_client import ApiClient, RequestSerialized +from scm.mobile_agent.api_response import ApiResponse +from scm.mobile_agent.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class RegionalAndCustomProxiesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_global_protect_regional_and_custom_proxies( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_regional_and_custom_proxies: Annotated[Optional[ForwardingProfileRegionalAndCustomProxies], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileRegionalAndCustomProxies: + """Create a GlobalProtect regional and custom proxy + + Create a new GlobalProtect regional and custom proxy + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_regional_and_custom_proxies: Created + :type forwarding_profile_regional_and_custom_proxies: ForwardingProfileRegionalAndCustomProxies + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxies_serialize( + folder=folder, + forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_regional_and_custom_proxies_with_http_info( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_regional_and_custom_proxies: Annotated[Optional[ForwardingProfileRegionalAndCustomProxies], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileRegionalAndCustomProxies]: + """Create a GlobalProtect regional and custom proxy + + Create a new GlobalProtect regional and custom proxy + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_regional_and_custom_proxies: Created + :type forwarding_profile_regional_and_custom_proxies: ForwardingProfileRegionalAndCustomProxies + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxies_serialize( + folder=folder, + forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_regional_and_custom_proxies_without_preload_content( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_regional_and_custom_proxies: Annotated[Optional[ForwardingProfileRegionalAndCustomProxies], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect regional and custom proxy + + Create a new GlobalProtect regional and custom proxy + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_regional_and_custom_proxies: Created + :type forwarding_profile_regional_and_custom_proxies: ForwardingProfileRegionalAndCustomProxies + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxies_serialize( + folder=folder, + forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_global_protect_regional_and_custom_proxies_serialize( + self, + folder, + forwarding_profile_regional_and_custom_proxies, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_regional_and_custom_proxies is not None: + _body_params = forwarding_profile_regional_and_custom_proxies + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/forwarding-profile-regional-and-custom-proxies', + 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 + @with_error_handling + def delete_global_protect_regional_and_custom_proxies( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect regional and custom proxy + + Delete a GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_regional_and_custom_proxies_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_regional_and_custom_proxies_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect regional and custom proxy + + Delete a GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_regional_and_custom_proxies_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_regional_and_custom_proxies_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect regional and custom proxy + + Delete a GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_regional_and_custom_proxies_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_global_protect_regional_and_custom_proxies_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/forwarding-profile-regional-and-custom-proxies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def get_global_protect_regional_and_custom_proxy_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileRegionalAndCustomProxies: + """Get a GlobalProtect regional and custom proxy + + Retrieve an existing GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_regional_and_custom_proxy_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_regional_and_custom_proxy_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileRegionalAndCustomProxies]: + """Get a GlobalProtect regional and custom proxy + + Retrieve an existing GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_regional_and_custom_proxy_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_regional_and_custom_proxy_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect regional and custom proxy + + Retrieve an existing GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_regional_and_custom_proxy_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_global_protect_regional_and_custom_proxy_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-regional-and-custom-proxies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_global_protect_regional_and_custom_proxies( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GlobalProtectRegionalAndCustomProxiesListResponse: + """List GlobalProtect regional and custom proxies + + Retrieve a list of GlobalProtect regional and custom proxies + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxies_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectRegionalAndCustomProxiesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_regional_and_custom_proxies_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[GlobalProtectRegionalAndCustomProxiesListResponse]: + """List GlobalProtect regional and custom proxies + + Retrieve a list of GlobalProtect regional and custom proxies + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxies_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectRegionalAndCustomProxiesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_regional_and_custom_proxies_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect regional and custom proxies + + Retrieve a list of GlobalProtect regional and custom proxies + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxies_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectRegionalAndCustomProxiesListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_global_protect_regional_and_custom_proxies_serialize( + self, + name, + limit, + offset, + folder, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-regional-and-custom-proxies', + 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 + @with_error_handling + def update_global_protect_regional_and_custom_proxy_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_regional_and_custom_proxies: Annotated[Optional[ForwardingProfileRegionalAndCustomProxies], Field(description="The regional and custom proxy resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileRegionalAndCustomProxies: + """Update a GlobalProtect regional and custom proxy + + Update an existing GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_regional_and_custom_proxies: The regional and custom proxy resource definition + :type forwarding_profile_regional_and_custom_proxies: ForwardingProfileRegionalAndCustomProxies + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxy_by_id_serialize( + id=id, + forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_regional_and_custom_proxy_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_regional_and_custom_proxies: Annotated[Optional[ForwardingProfileRegionalAndCustomProxies], Field(description="The regional and custom proxy resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileRegionalAndCustomProxies]: + """Update a GlobalProtect regional and custom proxy + + Update an existing GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_regional_and_custom_proxies: The regional and custom proxy resource definition + :type forwarding_profile_regional_and_custom_proxies: ForwardingProfileRegionalAndCustomProxies + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxy_by_id_serialize( + id=id, + forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_regional_and_custom_proxy_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_regional_and_custom_proxies: Annotated[Optional[ForwardingProfileRegionalAndCustomProxies], Field(description="The regional and custom proxy resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect regional and custom proxy + + Update an existing GlobalProtect regional and custom proxy + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_regional_and_custom_proxies: The regional and custom proxy resource definition + :type forwarding_profile_regional_and_custom_proxies: ForwardingProfileRegionalAndCustomProxies + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_regional_and_custom_proxy_by_id_serialize( + id=id, + forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileRegionalAndCustomProxies", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + + def fetch_regional_and_custom_proxies( + self, + name: str, + folder: Optional[str] = None, + snippet: Optional[str] = None, + device: Optional[str] = None, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single regional_and_custom_proxies object by name. + + This is a convenience method that uses server-side name filtering to retrieve + a specific object by its name within a container (folder, snippet, or device). + + Args: + name: The name of the object to fetch + folder: The folder in which the resource is defined + snippet: The snippet in which the resource is defined + device: The device in which the resource is defined + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_regional_and_custom_proxies(name="my-object", folder="Texas") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + # Build list parameters with server-side name filter + list_params = {'name': name, 'limit': 5000} + if folder is not None: + list_params['folder'] = folder + if snippet is not None: + list_params['snippet'] = snippet + if device is not None: + list_params['device'] = device + # Add any additional kwargs (excluding offset/limit/name which we handle separately) + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit', 'name']}) + + try: + response = self.list_global_protect_regional_and_custom_proxies(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Standard paginated response - verify exact name match + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name'): + if obj.name == name: + return obj + else: + return obj + + return None + + def _update_global_protect_regional_and_custom_proxy_by_id_serialize( + self, + id, + forwarding_profile_regional_and_custom_proxies, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_regional_and_custom_proxies is not None: + _body_params = forwarding_profile_regional_and_custom_proxies + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/forwarding-profile-regional-and-custom-proxies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/scm/mobile_agent/api/source_applications_api.py b/scm/mobile_agent/api/source_applications_api.py new file mode 100644 index 00000000..5376cdd8 --- /dev/null +++ b/scm/mobile_agent/api/source_applications_api.py @@ -0,0 +1,1602 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + 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 scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from scm.mobile_agent.models.global_protect_source_applications_list_response import GlobalProtectSourceApplicationsListResponse + +from scm.mobile_agent.api_client import ApiClient, RequestSerialized +from scm.mobile_agent.api_response import ApiResponse +from scm.mobile_agent.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class SourceApplicationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_global_protect_source_application( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_source_applications: Annotated[Optional[ForwardingProfileSourceApplications], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileSourceApplications: + """Create a GlobalProtect source application + + Create a new GlobalProtect source application + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_source_applications: Created + :type forwarding_profile_source_applications: ForwardingProfileSourceApplications + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_application_serialize( + folder=folder, + forwarding_profile_source_applications=forwarding_profile_source_applications, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_source_application_with_http_info( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_source_applications: Annotated[Optional[ForwardingProfileSourceApplications], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileSourceApplications]: + """Create a GlobalProtect source application + + Create a new GlobalProtect source application + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_source_applications: Created + :type forwarding_profile_source_applications: ForwardingProfileSourceApplications + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_application_serialize( + folder=folder, + forwarding_profile_source_applications=forwarding_profile_source_applications, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_source_application_without_preload_content( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_source_applications: Annotated[Optional[ForwardingProfileSourceApplications], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect source application + + Create a new GlobalProtect source application + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_source_applications: Created + :type forwarding_profile_source_applications: ForwardingProfileSourceApplications + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_application_serialize( + folder=folder, + forwarding_profile_source_applications=forwarding_profile_source_applications, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_global_protect_source_application_serialize( + self, + folder, + forwarding_profile_source_applications, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_source_applications is not None: + _body_params = forwarding_profile_source_applications + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/forwarding-profile-source-applications', + 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 + @with_error_handling + def delete_global_protect_source_application( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect source application + + Delete a GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_source_application_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_source_application_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect source application + + Delete a GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_source_application_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_source_application_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect source application + + Delete a GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_source_application_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_global_protect_source_application_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/forwarding-profile-source-applications/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def get_global_protect_source_application_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileSourceApplications: + """Get a GlobalProtect source application + + Retrieve an existing GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_source_application_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_source_application_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileSourceApplications]: + """Get a GlobalProtect source application + + Retrieve an existing GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_source_application_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_source_application_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect source application + + Retrieve an existing GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_source_application_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_global_protect_source_application_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-source-applications/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_global_protect_source_applications( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GlobalProtectSourceApplicationsListResponse: + """List GlobalProtect source applications + + Retrieve a list of GlobalProtect source applications + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_applications_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectSourceApplicationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_source_applications_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[GlobalProtectSourceApplicationsListResponse]: + """List GlobalProtect source applications + + Retrieve a list of GlobalProtect source applications + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_applications_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectSourceApplicationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_source_applications_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect source applications + + Retrieve a list of GlobalProtect source applications + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_applications_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectSourceApplicationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_global_protect_source_applications_serialize( + self, + name, + limit, + offset, + folder, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-source-applications', + 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 + @with_error_handling + def update_global_protect_source_application_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_source_applications: Annotated[Optional[ForwardingProfileSourceApplications], Field(description="The source application resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileSourceApplications: + """Update a GlobalProtect source application + + Update an existing GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_source_applications: The source application resource definition + :type forwarding_profile_source_applications: ForwardingProfileSourceApplications + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_application_by_id_serialize( + id=id, + forwarding_profile_source_applications=forwarding_profile_source_applications, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_source_application_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_source_applications: Annotated[Optional[ForwardingProfileSourceApplications], Field(description="The source application resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileSourceApplications]: + """Update a GlobalProtect source application + + Update an existing GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_source_applications: The source application resource definition + :type forwarding_profile_source_applications: ForwardingProfileSourceApplications + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_application_by_id_serialize( + id=id, + forwarding_profile_source_applications=forwarding_profile_source_applications, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_source_application_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_source_applications: Annotated[Optional[ForwardingProfileSourceApplications], Field(description="The source application resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect source application + + Update an existing GlobalProtect source application + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_source_applications: The source application resource definition + :type forwarding_profile_source_applications: ForwardingProfileSourceApplications + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_source_application_by_id_serialize( + id=id, + forwarding_profile_source_applications=forwarding_profile_source_applications, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileSourceApplications", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + + def fetch_source_applications( + self, + name: str, + folder: Optional[str] = None, + snippet: Optional[str] = None, + device: Optional[str] = None, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single source_applications object by name. + + This is a convenience method that uses server-side name filtering to retrieve + a specific object by its name within a container (folder, snippet, or device). + + Args: + name: The name of the object to fetch + folder: The folder in which the resource is defined + snippet: The snippet in which the resource is defined + device: The device in which the resource is defined + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_source_applications(name="my-object", folder="Texas") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + # Build list parameters with server-side name filter + list_params = {'name': name, 'limit': 5000} + if folder is not None: + list_params['folder'] = folder + if snippet is not None: + list_params['snippet'] = snippet + if device is not None: + list_params['device'] = device + # Add any additional kwargs (excluding offset/limit/name which we handle separately) + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit', 'name']}) + + try: + response = self.list_global_protect_source_applications(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Standard paginated response - verify exact name match + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name'): + if obj.name == name: + return obj + else: + return obj + + return None + + def _update_global_protect_source_application_by_id_serialize( + self, + id, + forwarding_profile_source_applications, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_source_applications is not None: + _body_params = forwarding_profile_source_applications + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/forwarding-profile-source-applications/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/scm/mobile_agent/api/user_locations_api.py b/scm/mobile_agent/api/user_locations_api.py new file mode 100644 index 00000000..a16af23f --- /dev/null +++ b/scm/mobile_agent/api/user_locations_api.py @@ -0,0 +1,1602 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + 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 scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from scm.mobile_agent.models.global_protect_user_locations_list_response import GlobalProtectUserLocationsListResponse + +from scm.mobile_agent.api_client import ApiClient, RequestSerialized +from scm.mobile_agent.api_response import ApiResponse +from scm.mobile_agent.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class UserLocationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_global_protect_user_location( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_user_locations: Annotated[Optional[ForwardingProfileUserLocations], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileUserLocations: + """Create a GlobalProtect user location + + Create a new GlobalProtect user location + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_user_locations: Created + :type forwarding_profile_user_locations: ForwardingProfileUserLocations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_location_serialize( + folder=folder, + forwarding_profile_user_locations=forwarding_profile_user_locations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_user_location_with_http_info( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_user_locations: Annotated[Optional[ForwardingProfileUserLocations], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileUserLocations]: + """Create a GlobalProtect user location + + Create a new GlobalProtect user location + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_user_locations: Created + :type forwarding_profile_user_locations: ForwardingProfileUserLocations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_location_serialize( + folder=folder, + forwarding_profile_user_locations=forwarding_profile_user_locations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def create_global_protect_user_location_without_preload_content( + self, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + forwarding_profile_user_locations: Annotated[Optional[ForwardingProfileUserLocations], Field(description="Created")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect user location + + Create a new GlobalProtect user location + + :param folder: The folder in which the resource is defined + :type folder: str + :param forwarding_profile_user_locations: Created + :type forwarding_profile_user_locations: ForwardingProfileUserLocations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_location_serialize( + folder=folder, + forwarding_profile_user_locations=forwarding_profile_user_locations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_global_protect_user_location_serialize( + self, + folder, + forwarding_profile_user_locations, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_user_locations is not None: + _body_params = forwarding_profile_user_locations + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/forwarding-profile-user-locations', + 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 + @with_error_handling + def delete_global_protect_user_location( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect user location + + Delete a GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_user_location_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_user_location_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect user location + + Delete a GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_user_location_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def delete_global_protect_user_location_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect user location + + Delete a GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_global_protect_user_location_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_global_protect_user_location_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/forwarding-profile-user-locations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def get_global_protect_user_location_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileUserLocations: + """Get a GlobalProtect user location + + Retrieve an existing GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_user_location_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_user_location_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileUserLocations]: + """Get a GlobalProtect user location + + Retrieve an existing GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_user_location_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def get_global_protect_user_location_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 a GlobalProtect user location + + Retrieve an existing GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_global_protect_user_location_by_id_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_global_protect_user_location_by_id_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-user-locations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_global_protect_user_locations( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GlobalProtectUserLocationsListResponse: + """List GlobalProtect user locations + + Retrieve a list of GlobalProtect user locations + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_locations_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectUserLocationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_user_locations_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[GlobalProtectUserLocationsListResponse]: + """List GlobalProtect user locations + + Retrieve a list of GlobalProtect user locations + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_locations_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectUserLocationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + 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 + @with_error_handling + def list_global_protect_user_locations_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="The name of the configuration resource")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of results per page")] = None, + offset: Annotated[Optional[StrictInt], Field(description="The offset into the list of results returned")] = None, + folder: Annotated[Optional[StrictStr], Field(description="The folder in which the resource is defined ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect user locations + + Retrieve a list of GlobalProtect user locations + + :param name: The name of the configuration resource + :type name: str + :param limit: The maximum number of results per page + :type limit: int + :param offset: The offset into the list of results returned + :type offset: int + :param folder: The folder in which the resource is defined + :type folder: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_locations_serialize( + name=name, + limit=limit, + offset=offset, + folder=folder, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GlobalProtectUserLocationsListResponse", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_global_protect_user_locations_serialize( + self, + name, + limit, + offset, + folder, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if offset is not None: + + _query_params.append(('offset', offset)) + + if folder is not None: + + _query_params.append(('folder', folder)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/forwarding-profile-user-locations', + 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 + @with_error_handling + def update_global_protect_user_location_by_id( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_user_locations: Annotated[Optional[ForwardingProfileUserLocations], Field(description="The user location resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ForwardingProfileUserLocations: + """Update a GlobalProtect user location + + Update an existing GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_user_locations: The user location resource definition + :type forwarding_profile_user_locations: ForwardingProfileUserLocations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_location_by_id_serialize( + id=id, + forwarding_profile_user_locations=forwarding_profile_user_locations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_user_location_by_id_with_http_info( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_user_locations: Annotated[Optional[ForwardingProfileUserLocations], Field(description="The user location resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ForwardingProfileUserLocations]: + """Update a GlobalProtect user location + + Update an existing GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_user_locations: The user location resource definition + :type forwarding_profile_user_locations: ForwardingProfileUserLocations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_location_by_id_serialize( + id=id, + forwarding_profile_user_locations=forwarding_profile_user_locations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + 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 + @with_error_handling + def update_global_protect_user_location_by_id_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="The UUID of the resource")], + forwarding_profile_user_locations: Annotated[Optional[ForwardingProfileUserLocations], Field(description="The user location resource definition")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 GlobalProtect user location + + Update an existing GlobalProtect user location + + :param id: The UUID of the resource (required) + :type id: str + :param forwarding_profile_user_locations: The user location resource definition + :type forwarding_profile_user_locations: ForwardingProfileUserLocations + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_global_protect_user_location_by_id_serialize( + id=id, + forwarding_profile_user_locations=forwarding_profile_user_locations, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ForwardingProfileUserLocations", + '400': "GenericError", + '401': "GenericError", + '403': "GenericError", + '404': "GenericError", + '409': "GenericError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + + def fetch_user_locations( + self, + name: str, + folder: Optional[str] = None, + snippet: Optional[str] = None, + device: Optional[str] = None, + **kwargs + ) -> Optional[Any]: + """ + Fetch a single user_locations object by name. + + This is a convenience method that uses server-side name filtering to retrieve + a specific object by its name within a container (folder, snippet, or device). + + Args: + name: The name of the object to fetch + folder: The folder in which the resource is defined + snippet: The snippet in which the resource is defined + device: The device in which the resource is defined + **kwargs: Additional keyword arguments + + Returns: + The matching object if found, None otherwise + + Example: + >>> obj = api.fetch_user_locations(name="my-object", folder="Texas") + >>> if obj: + ... print(f"Found: {obj.name}") + """ + # Build list parameters with server-side name filter + list_params = {'name': name, 'limit': 5000} + if folder is not None: + list_params['folder'] = folder + if snippet is not None: + list_params['snippet'] = snippet + if device is not None: + list_params['device'] = device + # Add any additional kwargs (excluding offset/limit/name which we handle separately) + list_params.update({k: v for k, v in kwargs.items() if k not in ['offset', 'limit', 'name']}) + + try: + response = self.list_global_protect_user_locations(**list_params) + except Exception as e: + # HTTP 404: object not found - return None + if hasattr(e, 'http_status_code') and e.http_status_code == 404: + return None + if hasattr(e, 'status') and e.status == 404: + return None + raise + + # Standard paginated response - verify exact name match + if hasattr(response, 'data') and response.data: + for obj in response.data: + if hasattr(obj, 'name'): + if obj.name == name: + return obj + else: + return obj + + return None + + def _update_global_protect_user_location_by_id_serialize( + self, + id, + forwarding_profile_user_locations, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if forwarding_profile_user_locations is not None: + _body_params = forwarding_profile_user_locations + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'scmToken' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/forwarding-profile-user-locations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/scm/mobile_agent/api_client.py b/scm/mobile_agent/api_client.py new file mode 100644 index 00000000..e6250597 --- /dev/null +++ b/scm/mobile_agent/api_client.py @@ -0,0 +1,798 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from scm.mobile_agent.configuration import Configuration +from scm.mobile_agent.api_response import ApiResponse, T as ApiResponseT +import scm.mobile_agent.models +from scm.mobile_agent import rest +from scm.mobile_agent.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(scm.mobile_agent.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/scm/mobile_agent/api_response.py b/scm/mobile_agent/api_response.py new file mode 100644 index 00000000..9bc7c11f --- /dev/null +++ b/scm/mobile_agent/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/scm/mobile_agent/configuration.py b/scm/mobile_agent/configuration.py new file mode 100644 index 00000000..f3893823 --- /dev/null +++ b/scm/mobile_agent/configuration.py @@ -0,0 +1,471 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + 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 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + + :Example: + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, + ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None + ) -> None: + """Constructor + """ + self._base_path = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("scm.mobile_agent") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """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. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if self.access_token is not None: + auth['scmOAuth'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + if self.access_token is not None: + auth['scmToken'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 2.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1", + 'description': "Current", + }, + { + 'url': "https://api.sase.paloaltonetworks.com/sse/config/v1/mobile-agent", + 'description': "Legacy", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/scm/mobile_agent/docs/BlockRuleBasic.md b/scm/mobile_agent/docs/BlockRuleBasic.md new file mode 100644 index 00000000..ec58b8c3 --- /dev/null +++ b/scm/mobile_agent/docs/BlockRuleBasic.md @@ -0,0 +1,32 @@ +# BlockRuleBasic + +Basic block rule configuration for PAC file and GlobalProtect proxy profiles + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_tcp** | [**BlockRuleBasicAllowTcp**](BlockRuleBasicAllowTcp.md) | | [optional] +**allow_udp** | [**BlockRuleBasicAllowUdp**](BlockRuleBasicAllowUdp.md) | | [optional] +**enable** | **bool** | Enable block rule | [optional] + +## Example + +```python +from scm.mobile_agent.models.block_rule_basic import BlockRuleBasic + +# TODO update the JSON string below +json = "{}" +# create an instance of BlockRuleBasic from a JSON string +block_rule_basic_instance = BlockRuleBasic.from_json(json) +# print the JSON string representation of the object +print(BlockRuleBasic.to_json()) + +# convert the object into a dict +block_rule_basic_dict = block_rule_basic_instance.to_dict() +# create an instance of BlockRuleBasic from a dict +block_rule_basic_from_dict = BlockRuleBasic.from_dict(block_rule_basic_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/scm/mobile_agent/docs/BlockRuleBasicAllowTcp.md b/scm/mobile_agent/docs/BlockRuleBasicAllowTcp.md new file mode 100644 index 00000000..4d1a5271 --- /dev/null +++ b/scm/mobile_agent/docs/BlockRuleBasicAllowTcp.md @@ -0,0 +1,31 @@ +# BlockRuleBasicAllowTcp + +TCP traffic allowlist configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enable_locations** | **bool** | Enable locations for allow-tcp | [optional] +**locations** | **List[str]** | List of user locations allowed for TCP traffic | [optional] + +## Example + +```python +from scm.mobile_agent.models.block_rule_basic_allow_tcp import BlockRuleBasicAllowTcp + +# TODO update the JSON string below +json = "{}" +# create an instance of BlockRuleBasicAllowTcp from a JSON string +block_rule_basic_allow_tcp_instance = BlockRuleBasicAllowTcp.from_json(json) +# print the JSON string representation of the object +print(BlockRuleBasicAllowTcp.to_json()) + +# convert the object into a dict +block_rule_basic_allow_tcp_dict = block_rule_basic_allow_tcp_instance.to_dict() +# create an instance of BlockRuleBasicAllowTcp from a dict +block_rule_basic_allow_tcp_from_dict = BlockRuleBasicAllowTcp.from_dict(block_rule_basic_allow_tcp_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/scm/mobile_agent/docs/BlockRuleBasicAllowUdp.md b/scm/mobile_agent/docs/BlockRuleBasicAllowUdp.md new file mode 100644 index 00000000..eb00bbbc --- /dev/null +++ b/scm/mobile_agent/docs/BlockRuleBasicAllowUdp.md @@ -0,0 +1,33 @@ +# BlockRuleBasicAllowUdp + +UDP traffic allowlist configuration with location and destination support + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destinations** | **str** | Destination addresses or networks allowed for UDP traffic | [optional] +**enable_destinations** | **bool** | Enable destinations for allow-udp | [optional] +**enable_locations** | **bool** | Enable locations for allow-udp | [optional] +**locations** | **List[str]** | List of user locations allowed for UDP traffic | [optional] + +## Example + +```python +from scm.mobile_agent.models.block_rule_basic_allow_udp import BlockRuleBasicAllowUdp + +# TODO update the JSON string below +json = "{}" +# create an instance of BlockRuleBasicAllowUdp from a JSON string +block_rule_basic_allow_udp_instance = BlockRuleBasicAllowUdp.from_json(json) +# print the JSON string representation of the object +print(BlockRuleBasicAllowUdp.to_json()) + +# convert the object into a dict +block_rule_basic_allow_udp_dict = block_rule_basic_allow_udp_instance.to_dict() +# create an instance of BlockRuleBasicAllowUdp from a dict +block_rule_basic_allow_udp_from_dict = BlockRuleBasicAllowUdp.from_dict(block_rule_basic_allow_udp_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/scm/mobile_agent/docs/BlockRuleZtna.md b/scm/mobile_agent/docs/BlockRuleZtna.md new file mode 100644 index 00000000..31a39509 --- /dev/null +++ b/scm/mobile_agent/docs/BlockRuleZtna.md @@ -0,0 +1,36 @@ +# BlockRuleZtna + +ZTNA block rule configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_icmp_for_troubleshooting** | **bool** | Allow ICMP for troubleshooting | [optional] [default to False] +**block_all_other_unmatched_outbound_connections** | **bool** | Block all other unmatched outbound connections | [optional] [default to False] +**block_inbound_access_when_connected_to_tunnel** | **bool** | Block inbound access when connected to tunnel | [optional] [default to False] +**block_non_tcp_non_udp_traffic_when_connected_to_tunnel** | **bool** | Block Non-TCP Non UDP based traffic when connected to tunnel | [optional] [default to False] +**block_outbound_lan_access_when_connected_to_tunnel** | **bool** | Block outbound LAN access when connected to tunnel | [optional] [default to False] +**enforcer_fqdn_dns_resolution_via_dns_servers** | **bool** | Enforce FQDN DNS resolution via tunnel DNS servers | [optional] [default to True] +**resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel** | **bool** | Resolve All FQDNs using DNS servers assigned by the tunnel (Windows Only) | [optional] [default to True] + +## Example + +```python +from scm.mobile_agent.models.block_rule_ztna import BlockRuleZtna + +# TODO update the JSON string below +json = "{}" +# create an instance of BlockRuleZtna from a JSON string +block_rule_ztna_instance = BlockRuleZtna.from_json(json) +# print the JSON string representation of the object +print(BlockRuleZtna.to_json()) + +# convert the object into a dict +block_rule_ztna_dict = block_rule_ztna_instance.to_dict() +# create an instance of BlockRuleZtna from a dict +block_rule_ztna_from_dict = BlockRuleZtna.from_dict(block_rule_ztna_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/scm/mobile_agent/docs/DestinationsApi.md b/scm/mobile_agent/docs/DestinationsApi.md new file mode 100644 index 00000000..a5bda923 --- /dev/null +++ b/scm/mobile_agent/docs/DestinationsApi.md @@ -0,0 +1,437 @@ +# scm.mobile_agent.DestinationsApi + +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/mobile-agent/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_global_protect_destination**](DestinationsApi.md#create_global_protect_destination) | **POST** /forwarding-profile-destinations | Create a GlobalProtect destination +[**delete_global_protect_destination**](DestinationsApi.md#delete_global_protect_destination) | **DELETE** /forwarding-profile-destinations/{id} | Delete a GlobalProtect destination +[**get_global_protect_destination_by_id**](DestinationsApi.md#get_global_protect_destination_by_id) | **GET** /forwarding-profile-destinations/{id} | Get a GlobalProtect destination +[**list_global_protect_destinations**](DestinationsApi.md#list_global_protect_destinations) | **GET** /forwarding-profile-destinations | List GlobalProtect destinations +[**update_global_protect_destination_by_id**](DestinationsApi.md#update_global_protect_destination_by_id) | **PUT** /forwarding-profile-destinations/{id} | Update a GlobalProtect destination + + +# **create_global_protect_destination** +> ForwardingProfileDestinations create_global_protect_destination(folder=folder, forwarding_profile_destinations=forwarding_profile_destinations) + +Create a GlobalProtect destination + +Create a new GlobalProtect destination + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.DestinationsApi(api_client) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + forwarding_profile_destinations = scm.mobile_agent.ForwardingProfileDestinations() # ForwardingProfileDestinations | Created (optional) + + try: + # Create a GlobalProtect destination + api_response = api_instance.create_global_protect_destination(folder=folder, forwarding_profile_destinations=forwarding_profile_destinations) + print("The response of DestinationsApi->create_global_protect_destination:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DestinationsApi->create_global_protect_destination: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **folder** | **str**| The folder in which the resource is defined | [optional] + **forwarding_profile_destinations** | [**ForwardingProfileDestinations**](ForwardingProfileDestinations.md)| Created | [optional] + +### Return type + +[**ForwardingProfileDestinations**](ForwardingProfileDestinations.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_destination** +> delete_global_protect_destination(id) + +Delete a GlobalProtect destination + +Delete a GlobalProtect destination + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.DestinationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Delete a GlobalProtect destination + api_instance.delete_global_protect_destination(id) + except Exception as e: + print("Exception when calling DestinationsApi->delete_global_protect_destination: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +void (empty response body) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_destination_by_id** +> ForwardingProfileDestinations get_global_protect_destination_by_id(id) + +Get a GlobalProtect destination + +Retrieve an existing GlobalProtect destination + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.DestinationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Get a GlobalProtect destination + api_response = api_instance.get_global_protect_destination_by_id(id) + print("The response of DestinationsApi->get_global_protect_destination_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DestinationsApi->get_global_protect_destination_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +[**ForwardingProfileDestinations**](ForwardingProfileDestinations.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_destinations** +> GlobalProtectDestinationsListResponse list_global_protect_destinations(name=name, limit=limit, offset=offset, folder=folder) + +List GlobalProtect destinations + +Retrieve a list of GlobalProtect destinations + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.global_protect_destinations_list_response import GlobalProtectDestinationsListResponse +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.DestinationsApi(api_client) + name = 'name_example' # str | The name of the configuration resource (optional) + limit = 200 # int | The maximum number of results per page (optional) (default to 200) + offset = 0 # int | The offset into the list of results returned (optional) (default to 0) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + + try: + # List GlobalProtect destinations + api_response = api_instance.list_global_protect_destinations(name=name, limit=limit, offset=offset, folder=folder) + print("The response of DestinationsApi->list_global_protect_destinations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DestinationsApi->list_global_protect_destinations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the configuration resource | [optional] + **limit** | **int**| The maximum number of results per page | [optional] [default to 200] + **offset** | **int**| The offset into the list of results returned | [optional] [default to 0] + **folder** | **str**| The folder in which the resource is defined | [optional] + +### Return type + +[**GlobalProtectDestinationsListResponse**](GlobalProtectDestinationsListResponse.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_destination_by_id** +> ForwardingProfileDestinations update_global_protect_destination_by_id(id, forwarding_profile_destinations=forwarding_profile_destinations) + +Update a GlobalProtect destination + +Update an existing GlobalProtect destination + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.DestinationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + forwarding_profile_destinations = scm.mobile_agent.ForwardingProfileDestinations() # ForwardingProfileDestinations | The destination resource definition (optional) + + try: + # Update a GlobalProtect destination + api_response = api_instance.update_global_protect_destination_by_id(id, forwarding_profile_destinations=forwarding_profile_destinations) + print("The response of DestinationsApi->update_global_protect_destination_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DestinationsApi->update_global_protect_destination_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + **forwarding_profile_destinations** | [**ForwardingProfileDestinations**](ForwardingProfileDestinations.md)| The destination resource definition | [optional] + +### Return type + +[**ForwardingProfileDestinations**](ForwardingProfileDestinations.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/mobile_agent/docs/ErrorDetailCauseInfo.md b/scm/mobile_agent/docs/ErrorDetailCauseInfo.md new file mode 100644 index 00000000..f1eeb4d7 --- /dev/null +++ b/scm/mobile_agent/docs/ErrorDetailCauseInfo.md @@ -0,0 +1,33 @@ +# ErrorDetailCauseInfo + +Detailed information about an error cause including code, message, and contextual details + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code identifying the type of error | [optional] +**details** | **object** | Additional error details as string or structured object | [optional] +**help** | **str** | Help text for resolving the error | [optional] +**message** | **str** | Human-readable error message | [optional] + +## Example + +```python +from scm.mobile_agent.models.error_detail_cause_info import ErrorDetailCauseInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorDetailCauseInfo from a JSON string +error_detail_cause_info_instance = ErrorDetailCauseInfo.from_json(json) +# print the JSON string representation of the object +print(ErrorDetailCauseInfo.to_json()) + +# convert the object into a dict +error_detail_cause_info_dict = error_detail_cause_info_instance.to_dict() +# create an instance of ErrorDetailCauseInfo from a dict +error_detail_cause_info_from_dict = ErrorDetailCauseInfo.from_dict(error_detail_cause_info_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/scm/mobile_agent/docs/ForwardingProfileDestinationFqdnEntry.md b/scm/mobile_agent/docs/ForwardingProfileDestinationFqdnEntry.md new file mode 100644 index 00000000..eeedc72d --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileDestinationFqdnEntry.md @@ -0,0 +1,31 @@ +# ForwardingProfileDestinationFqdnEntry + +FQDN entry destination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | alphanumeric string [*0-9a-zA-Z._-] and at most one $ by the end | +**port** | **int** | Port number for fqdn based destination | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_destination_fqdn_entry import ForwardingProfileDestinationFqdnEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileDestinationFqdnEntry from a JSON string +forwarding_profile_destination_fqdn_entry_instance = ForwardingProfileDestinationFqdnEntry.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileDestinationFqdnEntry.to_json()) + +# convert the object into a dict +forwarding_profile_destination_fqdn_entry_dict = forwarding_profile_destination_fqdn_entry_instance.to_dict() +# create an instance of ForwardingProfileDestinationFqdnEntry from a dict +forwarding_profile_destination_fqdn_entry_from_dict = ForwardingProfileDestinationFqdnEntry.from_dict(forwarding_profile_destination_fqdn_entry_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/scm/mobile_agent/docs/ForwardingProfileDestinationIpEntry.md b/scm/mobile_agent/docs/ForwardingProfileDestinationIpEntry.md new file mode 100644 index 00000000..90ab0e7e --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileDestinationIpEntry.md @@ -0,0 +1,31 @@ +# ForwardingProfileDestinationIpEntry + +IP address entry destination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | IP address with wildcards and CIDR notation support | +**port** | **int** | Port number for IP address based destination | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_destination_ip_entry import ForwardingProfileDestinationIpEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileDestinationIpEntry from a JSON string +forwarding_profile_destination_ip_entry_instance = ForwardingProfileDestinationIpEntry.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileDestinationIpEntry.to_json()) + +# convert the object into a dict +forwarding_profile_destination_ip_entry_dict = forwarding_profile_destination_ip_entry_instance.to_dict() +# create an instance of ForwardingProfileDestinationIpEntry from a dict +forwarding_profile_destination_ip_entry_from_dict = ForwardingProfileDestinationIpEntry.from_dict(forwarding_profile_destination_ip_entry_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/scm/mobile_agent/docs/ForwardingProfileDestinations.md b/scm/mobile_agent/docs/ForwardingProfileDestinations.md new file mode 100644 index 00000000..a477445b --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileDestinations.md @@ -0,0 +1,33 @@ +# ForwardingProfileDestinations + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | description of the destination | [optional] +**fqdn** | [**List[ForwardingProfileDestinationFqdnEntry]**](ForwardingProfileDestinationFqdnEntry.md) | List of FQDN based destination entries | [optional] +**id** | **str** | The UUID of the destination | [optional] [readonly] +**ip_addresses** | [**List[ForwardingProfileDestinationIpEntry]**](ForwardingProfileDestinationIpEntry.md) | List of IP address based destination entries | [optional] +**name** | **str** | alphanumeric string [ 0-9a-zA-Z._ -] | + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileDestinations from a JSON string +forwarding_profile_destinations_instance = ForwardingProfileDestinations.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileDestinations.to_json()) + +# convert the object into a dict +forwarding_profile_destinations_dict = forwarding_profile_destinations_instance.to_dict() +# create an instance of ForwardingProfileDestinations from a dict +forwarding_profile_destinations_from_dict = ForwardingProfileDestinations.from_dict(forwarding_profile_destinations_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/scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxy.md b/scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxy.md new file mode 100644 index 00000000..537a9ff9 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxy.md @@ -0,0 +1,30 @@ +# ForwardingProfileGlobalProtectProxy + +GlobalProtect proxy-based forwarding profile configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**global_protect_proxy** | [**ForwardingProfileGlobalProtectProxyGlobalProtectProxy**](ForwardingProfileGlobalProtectProxyGlobalProtectProxy.md) | | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy import ForwardingProfileGlobalProtectProxy + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileGlobalProtectProxy from a JSON string +forwarding_profile_global_protect_proxy_instance = ForwardingProfileGlobalProtectProxy.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileGlobalProtectProxy.to_json()) + +# convert the object into a dict +forwarding_profile_global_protect_proxy_dict = forwarding_profile_global_protect_proxy_instance.to_dict() +# create an instance of ForwardingProfileGlobalProtectProxy from a dict +forwarding_profile_global_protect_proxy_from_dict = ForwardingProfileGlobalProtectProxy.from_dict(forwarding_profile_global_protect_proxy_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/scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxyGlobalProtectProxy.md b/scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxyGlobalProtectProxy.md new file mode 100644 index 00000000..4c9072e6 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileGlobalProtectProxyGlobalProtectProxy.md @@ -0,0 +1,32 @@ +# ForwardingProfileGlobalProtectProxyGlobalProtectProxy + +Global Protect proxy-based forwarding configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**block_rule** | [**BlockRuleBasic**](BlockRuleBasic.md) | | [optional] +**forwarding_rules** | [**List[ForwardingRuleBasic]**](ForwardingRuleBasic.md) | List of GlobalProtect proxy-based forwarding rules | [optional] +**pac_upload** | **bool** | User uploaded PAC file for Global Protect proxy-based forwarding configuration | [optional] [default to False] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy_global_protect_proxy import ForwardingProfileGlobalProtectProxyGlobalProtectProxy + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileGlobalProtectProxyGlobalProtectProxy from a JSON string +forwarding_profile_global_protect_proxy_global_protect_proxy_instance = ForwardingProfileGlobalProtectProxyGlobalProtectProxy.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileGlobalProtectProxyGlobalProtectProxy.to_json()) + +# convert the object into a dict +forwarding_profile_global_protect_proxy_global_protect_proxy_dict = forwarding_profile_global_protect_proxy_global_protect_proxy_instance.to_dict() +# create an instance of ForwardingProfileGlobalProtectProxyGlobalProtectProxy from a dict +forwarding_profile_global_protect_proxy_global_protect_proxy_from_dict = ForwardingProfileGlobalProtectProxyGlobalProtectProxy.from_dict(forwarding_profile_global_protect_proxy_global_protect_proxy_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/scm/mobile_agent/docs/ForwardingProfilePacFile.md b/scm/mobile_agent/docs/ForwardingProfilePacFile.md new file mode 100644 index 00000000..4dbb93ea --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfilePacFile.md @@ -0,0 +1,30 @@ +# ForwardingProfilePacFile + +PAC file-based forwarding profile configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pac_file** | [**ForwardingProfilePacFilePacFile**](ForwardingProfilePacFilePacFile.md) | | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_pac_file import ForwardingProfilePacFile + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfilePacFile from a JSON string +forwarding_profile_pac_file_instance = ForwardingProfilePacFile.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfilePacFile.to_json()) + +# convert the object into a dict +forwarding_profile_pac_file_dict = forwarding_profile_pac_file_instance.to_dict() +# create an instance of ForwardingProfilePacFile from a dict +forwarding_profile_pac_file_from_dict = ForwardingProfilePacFile.from_dict(forwarding_profile_pac_file_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/scm/mobile_agent/docs/ForwardingProfilePacFilePacFile.md b/scm/mobile_agent/docs/ForwardingProfilePacFilePacFile.md new file mode 100644 index 00000000..70a1d773 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfilePacFilePacFile.md @@ -0,0 +1,32 @@ +# ForwardingProfilePacFilePacFile + +PAC file based forwarding configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**block_rule** | [**BlockRuleBasic**](BlockRuleBasic.md) | | [optional] +**forwarding_rules** | [**List[ForwardingRuleBasic]**](ForwardingRuleBasic.md) | List of PAC file-based forwarding rules | [optional] +**pac_upload** | **bool** | User upload PAC file for PAC file based forwarding configuration | [optional] [default to False] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_pac_file_pac_file import ForwardingProfilePacFilePacFile + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfilePacFilePacFile from a JSON string +forwarding_profile_pac_file_pac_file_instance = ForwardingProfilePacFilePacFile.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfilePacFilePacFile.to_json()) + +# convert the object into a dict +forwarding_profile_pac_file_pac_file_dict = forwarding_profile_pac_file_pac_file_instance.to_dict() +# create an instance of ForwardingProfilePacFilePacFile from a dict +forwarding_profile_pac_file_pac_file_from_dict = ForwardingProfilePacFilePacFile.from_dict(forwarding_profile_pac_file_pac_file_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/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxies.md b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxies.md new file mode 100644 index 00000000..25e97d6b --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxies.md @@ -0,0 +1,38 @@ +# ForwardingProfileRegionalAndCustomProxies + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connectivity_preference** | [**List[ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner]**](ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.md) | List of connectivity methods and their enablement status for establishing proxy connections | [optional] +**description** | **str** | regional and custom proxy configuration description | [optional] +**fallback_option** | **str** | Behavior when proxy connection fails - 'fail-open' allows direct internet access, 'fail-safe' blocks traffic until proxy is restored | [optional] +**id** | **str** | The UUID of the regional and custom proxy | [optional] [readonly] +**location_preference** | **str** | Strategy for selecting Prisma Access location - 'best-available-pa-location' automatically selects optimal location, 'specific-pa-location' uses predefined locations | [optional] +**name** | **str** | alphanumeric string [ 0-9a-zA-Z ._-] | +**prisma_access_locations** | [**List[ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner]**](ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.md) | Select Prisma Access location Americas, Europe and Asia-Pacific. | [optional] +**proxy_1** | [**ForwardingProfileRegionalAndCustomProxiesProxy1**](ForwardingProfileRegionalAndCustomProxiesProxy1.md) | | [optional] +**proxy_2** | [**ForwardingProfileRegionalAndCustomProxiesProxy2**](ForwardingProfileRegionalAndCustomProxiesProxy2.md) | | [optional] +**type** | **str** | Proxy configuration type - 'gp-and-pac' for GlobalProtect and PAC file forwarding, 'ztna-agent' for ZTNA agent forwarding | [optional] [default to 'gp-and-pac'] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileRegionalAndCustomProxies from a JSON string +forwarding_profile_regional_and_custom_proxies_instance = ForwardingProfileRegionalAndCustomProxies.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileRegionalAndCustomProxies.to_json()) + +# convert the object into a dict +forwarding_profile_regional_and_custom_proxies_dict = forwarding_profile_regional_and_custom_proxies_instance.to_dict() +# create an instance of ForwardingProfileRegionalAndCustomProxies from a dict +forwarding_profile_regional_and_custom_proxies_from_dict = ForwardingProfileRegionalAndCustomProxies.from_dict(forwarding_profile_regional_and_custom_proxies_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/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.md b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.md new file mode 100644 index 00000000..bb8899b0 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.md @@ -0,0 +1,30 @@ +# ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | Indicates whether this connectivity method is enabled for use in the proxy configuration | [optional] [default to False] +**name** | **str** | Connectivity method type - 'tunnel' for VPN tunnels, 'proxy' for HTTP/HTTPS proxies, 'adns' for authenticated DNS, 'masque' for MASQUE protocol | + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner import ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner from a JSON string +forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner_instance = ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.to_json()) + +# convert the object into a dict +forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner_dict = forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner_instance.to_dict() +# create an instance of ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner from a dict +forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner_from_dict = ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.from_dict(forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner_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/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.md b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.md new file mode 100644 index 00000000..af2dbba3 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.md @@ -0,0 +1,30 @@ +# ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**locations** | **List[str]** | Add list of locations separated by space, in that region | [optional] +**name** | **str** | One of the region from 'americas', 'europe', 'apac' | + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner import ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner from a JSON string +forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner_instance = ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.to_json()) + +# convert the object into a dict +forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner_dict = forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner_instance.to_dict() +# create an instance of ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner from a dict +forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner_from_dict = ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.from_dict(forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner_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/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy1.md b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy1.md new file mode 100644 index 00000000..1366d7d0 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy1.md @@ -0,0 +1,32 @@ +# ForwardingProfileRegionalAndCustomProxiesProxy1 + +primary regional and custom proxy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fqdn** | **str** | fqdn of the primary proxy server (supports wildcards and alphanumeric characters with dots, hyphens, and underscores) | [optional] +**location** | **str** | Geographic or network location identifier for the primary proxy server | [optional] +**port** | **int** | port number for primary proxy | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy1 import ForwardingProfileRegionalAndCustomProxiesProxy1 + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileRegionalAndCustomProxiesProxy1 from a JSON string +forwarding_profile_regional_and_custom_proxies_proxy1_instance = ForwardingProfileRegionalAndCustomProxiesProxy1.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileRegionalAndCustomProxiesProxy1.to_json()) + +# convert the object into a dict +forwarding_profile_regional_and_custom_proxies_proxy1_dict = forwarding_profile_regional_and_custom_proxies_proxy1_instance.to_dict() +# create an instance of ForwardingProfileRegionalAndCustomProxiesProxy1 from a dict +forwarding_profile_regional_and_custom_proxies_proxy1_from_dict = ForwardingProfileRegionalAndCustomProxiesProxy1.from_dict(forwarding_profile_regional_and_custom_proxies_proxy1_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/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy2.md b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy2.md new file mode 100644 index 00000000..bfbf6196 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileRegionalAndCustomProxiesProxy2.md @@ -0,0 +1,32 @@ +# ForwardingProfileRegionalAndCustomProxiesProxy2 + +secondary regional and custom proxy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fqdn** | **str** | Fqdn of the secondary (backup) proxy server used for failover scenarios | [optional] +**location** | **str** | Geographic or network location identifier for the secondary proxy server | [optional] +**port** | **int** | port number for secondary proxy | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy2 import ForwardingProfileRegionalAndCustomProxiesProxy2 + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileRegionalAndCustomProxiesProxy2 from a JSON string +forwarding_profile_regional_and_custom_proxies_proxy2_instance = ForwardingProfileRegionalAndCustomProxiesProxy2.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileRegionalAndCustomProxiesProxy2.to_json()) + +# convert the object into a dict +forwarding_profile_regional_and_custom_proxies_proxy2_dict = forwarding_profile_regional_and_custom_proxies_proxy2_instance.to_dict() +# create an instance of ForwardingProfileRegionalAndCustomProxiesProxy2 from a dict +forwarding_profile_regional_and_custom_proxies_proxy2_from_dict = ForwardingProfileRegionalAndCustomProxiesProxy2.from_dict(forwarding_profile_regional_and_custom_proxies_proxy2_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/scm/mobile_agent/docs/ForwardingProfileSourceApplications.md b/scm/mobile_agent/docs/ForwardingProfileSourceApplications.md new file mode 100644 index 00000000..d8b7c931 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileSourceApplications.md @@ -0,0 +1,32 @@ +# ForwardingProfileSourceApplications + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**applications** | **List[str]** | List of application names to be included in this source application profile | +**description** | **str** | fowarding profile source application description | [optional] +**id** | **str** | The id of the source application | [optional] [readonly] +**name** | **str** | The unique name identifying the source application. Must be alphanumeric with allowed characters [0-9a-zA-Z._-] | + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileSourceApplications from a JSON string +forwarding_profile_source_applications_instance = ForwardingProfileSourceApplications.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileSourceApplications.to_json()) + +# convert the object into a dict +forwarding_profile_source_applications_dict = forwarding_profile_source_applications_instance.to_dict() +# create an instance of ForwardingProfileSourceApplications from a dict +forwarding_profile_source_applications_from_dict = ForwardingProfileSourceApplications.from_dict(forwarding_profile_source_applications_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/scm/mobile_agent/docs/ForwardingProfileUserLocations.md b/scm/mobile_agent/docs/ForwardingProfileUserLocations.md new file mode 100644 index 00000000..b3906ec9 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileUserLocations.md @@ -0,0 +1,33 @@ +# ForwardingProfileUserLocations + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | Description of the user location | [optional] +**id** | **str** | The UUID of the user location | [optional] [readonly] +**internal_host_detection** | [**ForwardingProfileUserLocationsInternalHostDetection**](ForwardingProfileUserLocationsInternalHostDetection.md) | | [optional] +**ip_addresses** | **List[str]** | List of IP addresses that define the user location | [optional] +**name** | **str** | alphanumeric string [ 0-9a-zA-Z._-] | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileUserLocations from a JSON string +forwarding_profile_user_locations_instance = ForwardingProfileUserLocations.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileUserLocations.to_json()) + +# convert the object into a dict +forwarding_profile_user_locations_dict = forwarding_profile_user_locations_instance.to_dict() +# create an instance of ForwardingProfileUserLocations from a dict +forwarding_profile_user_locations_from_dict = ForwardingProfileUserLocations.from_dict(forwarding_profile_user_locations_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/scm/mobile_agent/docs/ForwardingProfileUserLocationsInternalHostDetection.md b/scm/mobile_agent/docs/ForwardingProfileUserLocationsInternalHostDetection.md new file mode 100644 index 00000000..3a58e884 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileUserLocationsInternalHostDetection.md @@ -0,0 +1,31 @@ +# ForwardingProfileUserLocationsInternalHostDetection + +Configuration for detecting internal hosts using IP address and FQDN + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fqdn** | **str** | user location fqdn | +**ip_address** | **str** | user location ip address | + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_user_locations_internal_host_detection import ForwardingProfileUserLocationsInternalHostDetection + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileUserLocationsInternalHostDetection from a JSON string +forwarding_profile_user_locations_internal_host_detection_instance = ForwardingProfileUserLocationsInternalHostDetection.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileUserLocationsInternalHostDetection.to_json()) + +# convert the object into a dict +forwarding_profile_user_locations_internal_host_detection_dict = forwarding_profile_user_locations_internal_host_detection_instance.to_dict() +# create an instance of ForwardingProfileUserLocationsInternalHostDetection from a dict +forwarding_profile_user_locations_internal_host_detection_from_dict = ForwardingProfileUserLocationsInternalHostDetection.from_dict(forwarding_profile_user_locations_internal_host_detection_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/scm/mobile_agent/docs/ForwardingProfileZtnaAgent.md b/scm/mobile_agent/docs/ForwardingProfileZtnaAgent.md new file mode 100644 index 00000000..9b587ab3 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileZtnaAgent.md @@ -0,0 +1,30 @@ +# ForwardingProfileZtnaAgent + +ZTNA agent-based forwarding profile configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ztna_agent** | [**ForwardingProfileZtnaAgentZtnaAgent**](ForwardingProfileZtnaAgentZtnaAgent.md) | | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_ztna_agent import ForwardingProfileZtnaAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileZtnaAgent from a JSON string +forwarding_profile_ztna_agent_instance = ForwardingProfileZtnaAgent.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileZtnaAgent.to_json()) + +# convert the object into a dict +forwarding_profile_ztna_agent_dict = forwarding_profile_ztna_agent_instance.to_dict() +# create an instance of ForwardingProfileZtnaAgent from a dict +forwarding_profile_ztna_agent_from_dict = ForwardingProfileZtnaAgent.from_dict(forwarding_profile_ztna_agent_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/scm/mobile_agent/docs/ForwardingProfileZtnaAgentZtnaAgent.md b/scm/mobile_agent/docs/ForwardingProfileZtnaAgentZtnaAgent.md new file mode 100644 index 00000000..4efabbf2 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfileZtnaAgentZtnaAgent.md @@ -0,0 +1,32 @@ +# ForwardingProfileZtnaAgentZtnaAgent + +ZTNA agent-based forwarding configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**block_rule** | [**BlockRuleZtna**](BlockRuleZtna.md) | | [optional] +**forwarding_rules** | [**List[ForwardingRuleZtna]**](ForwardingRuleZtna.md) | List of ZTNA agent-based forwarding rules | [optional] +**pac_upload** | **bool** | User uploaded PAC file for a ZTNA agent-based forwarding configuration | [optional] [default to False] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profile_ztna_agent_ztna_agent import ForwardingProfileZtnaAgentZtnaAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfileZtnaAgentZtnaAgent from a JSON string +forwarding_profile_ztna_agent_ztna_agent_instance = ForwardingProfileZtnaAgentZtnaAgent.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfileZtnaAgentZtnaAgent.to_json()) + +# convert the object into a dict +forwarding_profile_ztna_agent_ztna_agent_dict = forwarding_profile_ztna_agent_ztna_agent_instance.to_dict() +# create an instance of ForwardingProfileZtnaAgentZtnaAgent from a dict +forwarding_profile_ztna_agent_ztna_agent_from_dict = ForwardingProfileZtnaAgentZtnaAgent.from_dict(forwarding_profile_ztna_agent_ztna_agent_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/scm/mobile_agent/docs/ForwardingProfiles.md b/scm/mobile_agent/docs/ForwardingProfiles.md new file mode 100644 index 00000000..421b98ac --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfiles.md @@ -0,0 +1,33 @@ +# ForwardingProfiles + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**definition_method** | **str** | Enable forwarding rule for forwarding profile | [optional] [default to 'rules'] +**description** | **str** | Forwarding profile description | [optional] +**id** | **str** | The UUID of the forwarding profile | [optional] [readonly] +**name** | **str** | forwarding profile name as an alphanumeric string [ 0-9a-zA-Z._ -] | +**type** | [**ForwardingProfilesType**](ForwardingProfilesType.md) | | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfiles from a JSON string +forwarding_profiles_instance = ForwardingProfiles.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfiles.to_json()) + +# convert the object into a dict +forwarding_profiles_dict = forwarding_profiles_instance.to_dict() +# create an instance of ForwardingProfiles from a dict +forwarding_profiles_from_dict = ForwardingProfiles.from_dict(forwarding_profiles_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/scm/mobile_agent/docs/ForwardingProfilesApi.md b/scm/mobile_agent/docs/ForwardingProfilesApi.md new file mode 100644 index 00000000..0dbd34f8 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfilesApi.md @@ -0,0 +1,437 @@ +# scm.mobile_agent.ForwardingProfilesApi + +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/mobile-agent/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_global_protect_forwarding_profile**](ForwardingProfilesApi.md#create_global_protect_forwarding_profile) | **POST** /forwarding-profiles | Create a GlobalProtect forwarding profile +[**delete_global_protect_forwarding_profile**](ForwardingProfilesApi.md#delete_global_protect_forwarding_profile) | **DELETE** /forwarding-profiles/{id} | Delete a GlobalProtect forwarding profile +[**get_global_protect_forwarding_profile_by_id**](ForwardingProfilesApi.md#get_global_protect_forwarding_profile_by_id) | **GET** /forwarding-profiles/{id} | Get a GlobalProtect forwarding profile +[**list_global_protect_forwarding_profiles**](ForwardingProfilesApi.md#list_global_protect_forwarding_profiles) | **GET** /forwarding-profiles | List GlobalProtect forwarding profiles +[**update_global_protect_forwarding_profile_by_id**](ForwardingProfilesApi.md#update_global_protect_forwarding_profile_by_id) | **PUT** /forwarding-profiles/{id} | Update a GlobalProtect forwarding profile + + +# **create_global_protect_forwarding_profile** +> ForwardingProfiles create_global_protect_forwarding_profile(folder=folder, forwarding_profiles=forwarding_profiles) + +Create a GlobalProtect forwarding profile + +Create a new GlobalProtect forwarding profile + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.ForwardingProfilesApi(api_client) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + forwarding_profiles = scm.mobile_agent.ForwardingProfiles() # ForwardingProfiles | Created (optional) + + try: + # Create a GlobalProtect forwarding profile + api_response = api_instance.create_global_protect_forwarding_profile(folder=folder, forwarding_profiles=forwarding_profiles) + print("The response of ForwardingProfilesApi->create_global_protect_forwarding_profile:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ForwardingProfilesApi->create_global_protect_forwarding_profile: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **folder** | **str**| The folder in which the resource is defined | [optional] + **forwarding_profiles** | [**ForwardingProfiles**](ForwardingProfiles.md)| Created | [optional] + +### Return type + +[**ForwardingProfiles**](ForwardingProfiles.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_forwarding_profile** +> delete_global_protect_forwarding_profile(id) + +Delete a GlobalProtect forwarding profile + +Delete a GlobalProtect forwarding profile + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.ForwardingProfilesApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Delete a GlobalProtect forwarding profile + api_instance.delete_global_protect_forwarding_profile(id) + except Exception as e: + print("Exception when calling ForwardingProfilesApi->delete_global_protect_forwarding_profile: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +void (empty response body) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_forwarding_profile_by_id** +> ForwardingProfiles get_global_protect_forwarding_profile_by_id(id) + +Get a GlobalProtect forwarding profile + +Retrieve an existing GlobalProtect forwarding profile + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.ForwardingProfilesApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Get a GlobalProtect forwarding profile + api_response = api_instance.get_global_protect_forwarding_profile_by_id(id) + print("The response of ForwardingProfilesApi->get_global_protect_forwarding_profile_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ForwardingProfilesApi->get_global_protect_forwarding_profile_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +[**ForwardingProfiles**](ForwardingProfiles.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_forwarding_profiles** +> GlobalProtectForwardingProfilesListResponse list_global_protect_forwarding_profiles(name=name, limit=limit, offset=offset, folder=folder) + +List GlobalProtect forwarding profiles + +Retrieve a list of GlobalProtect forwarding profiles + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.global_protect_forwarding_profiles_list_response import GlobalProtectForwardingProfilesListResponse +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.ForwardingProfilesApi(api_client) + name = 'name_example' # str | The name of the configuration resource (optional) + limit = 200 # int | The maximum number of results per page (optional) (default to 200) + offset = 0 # int | The offset into the list of results returned (optional) (default to 0) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + + try: + # List GlobalProtect forwarding profiles + api_response = api_instance.list_global_protect_forwarding_profiles(name=name, limit=limit, offset=offset, folder=folder) + print("The response of ForwardingProfilesApi->list_global_protect_forwarding_profiles:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ForwardingProfilesApi->list_global_protect_forwarding_profiles: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the configuration resource | [optional] + **limit** | **int**| The maximum number of results per page | [optional] [default to 200] + **offset** | **int**| The offset into the list of results returned | [optional] [default to 0] + **folder** | **str**| The folder in which the resource is defined | [optional] + +### Return type + +[**GlobalProtectForwardingProfilesListResponse**](GlobalProtectForwardingProfilesListResponse.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_forwarding_profile_by_id** +> ForwardingProfiles update_global_protect_forwarding_profile_by_id(id, forwarding_profiles=forwarding_profiles) + +Update a GlobalProtect forwarding profile + +Update an existing GlobalProtect forwarding profile + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.ForwardingProfilesApi(api_client) + id = 'id_example' # str | The UUID of the resource + forwarding_profiles = scm.mobile_agent.ForwardingProfiles() # ForwardingProfiles | The forwarding profile resource definition (optional) + + try: + # Update a GlobalProtect forwarding profile + api_response = api_instance.update_global_protect_forwarding_profile_by_id(id, forwarding_profiles=forwarding_profiles) + print("The response of ForwardingProfilesApi->update_global_protect_forwarding_profile_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ForwardingProfilesApi->update_global_protect_forwarding_profile_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + **forwarding_profiles** | [**ForwardingProfiles**](ForwardingProfiles.md)| The forwarding profile resource definition | [optional] + +### Return type + +[**ForwardingProfiles**](ForwardingProfiles.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/mobile_agent/docs/ForwardingProfilesType.md b/scm/mobile_agent/docs/ForwardingProfilesType.md new file mode 100644 index 00000000..dadea307 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingProfilesType.md @@ -0,0 +1,32 @@ +# ForwardingProfilesType + +Forwarding profile type configuration (PAC file, GlobalProtect proxy, or ZTNA agent) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**global_protect_proxy** | [**ForwardingProfileGlobalProtectProxyGlobalProtectProxy**](ForwardingProfileGlobalProtectProxyGlobalProtectProxy.md) | | [optional] +**pac_file** | [**ForwardingProfilePacFilePacFile**](ForwardingProfilePacFilePacFile.md) | | [optional] +**ztna_agent** | [**ForwardingProfileZtnaAgentZtnaAgent**](ForwardingProfileZtnaAgentZtnaAgent.md) | | [optional] + +## Example + +```python +from scm.mobile_agent.models.forwarding_profiles_type import ForwardingProfilesType + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingProfilesType from a JSON string +forwarding_profiles_type_instance = ForwardingProfilesType.from_json(json) +# print the JSON string representation of the object +print(ForwardingProfilesType.to_json()) + +# convert the object into a dict +forwarding_profiles_type_dict = forwarding_profiles_type_instance.to_dict() +# create an instance of ForwardingProfilesType from a dict +forwarding_profiles_type_from_dict = ForwardingProfilesType.from_dict(forwarding_profiles_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/scm/mobile_agent/docs/ForwardingRuleBasic.md b/scm/mobile_agent/docs/ForwardingRuleBasic.md new file mode 100644 index 00000000..4009e626 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingRuleBasic.md @@ -0,0 +1,34 @@ +# ForwardingRuleBasic + +Basic forwarding rule configuration for PAC file and GlobalProtect proxy profiles + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connectivity** | **str** | Connectivity method for this forwarding rule (e.g. direct) | [optional] [default to 'direct'] +**destinations** | **str** | Destination scope this forwarding rule applies to | [optional] [default to 'Any'] +**enabled** | **bool** | Enable a basic forwarding rule | [optional] [default to True] +**name** | **str** | Basic forwarding rule name as an alphanumeric string [ 0-9a-zA-Z._ -] | +**user_locations** | **str** | User location scope this rule applies to | [optional] [default to 'Any'] + +## Example + +```python +from scm.mobile_agent.models.forwarding_rule_basic import ForwardingRuleBasic + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingRuleBasic from a JSON string +forwarding_rule_basic_instance = ForwardingRuleBasic.from_json(json) +# print the JSON string representation of the object +print(ForwardingRuleBasic.to_json()) + +# convert the object into a dict +forwarding_rule_basic_dict = forwarding_rule_basic_instance.to_dict() +# create an instance of ForwardingRuleBasic from a dict +forwarding_rule_basic_from_dict = ForwardingRuleBasic.from_dict(forwarding_rule_basic_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/scm/mobile_agent/docs/ForwardingRuleZtna.md b/scm/mobile_agent/docs/ForwardingRuleZtna.md new file mode 100644 index 00000000..5d3b1f30 --- /dev/null +++ b/scm/mobile_agent/docs/ForwardingRuleZtna.md @@ -0,0 +1,36 @@ +# ForwardingRuleZtna + +ZTNA forwarding rule configuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connectivity** | **str** | Connectivity method for this ZTNA forwarding rule (e.g. direct) | [optional] [default to 'direct'] +**destinations** | **str** | Destination scope this ZTNA forwarding rule applies to | [optional] [default to 'Any'] +**enabled** | **bool** | Enable a forwarding rule ztna | [optional] [default to True] +**name** | **str** | Forwarding rule ZTNA name as an alphanumeric string [ 0-9a-zA-Z._ -] | +**source_applications** | **str** | Source applications this ZTNA rule applies to | [optional] [default to 'Any'] +**traffic_type** | **str** | Type of traffic this ZTNA rule applies to (dns, network, or both) | [optional] [default to 'dns'] +**user_locations** | **str** | User location scope this ZTNA rule applies to | [optional] [default to 'Any'] + +## Example + +```python +from scm.mobile_agent.models.forwarding_rule_ztna import ForwardingRuleZtna + +# TODO update the JSON string below +json = "{}" +# create an instance of ForwardingRuleZtna from a JSON string +forwarding_rule_ztna_instance = ForwardingRuleZtna.from_json(json) +# print the JSON string representation of the object +print(ForwardingRuleZtna.to_json()) + +# convert the object into a dict +forwarding_rule_ztna_dict = forwarding_rule_ztna_instance.to_dict() +# create an instance of ForwardingRuleZtna from a dict +forwarding_rule_ztna_from_dict = ForwardingRuleZtna.from_dict(forwarding_rule_ztna_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/scm/mobile_agent/docs/GenericError.md b/scm/mobile_agent/docs/GenericError.md new file mode 100644 index 00000000..18c8cc99 --- /dev/null +++ b/scm/mobile_agent/docs/GenericError.md @@ -0,0 +1,31 @@ +# GenericError + +Generic error response structure + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**List[ErrorDetailCauseInfo]**](ErrorDetailCauseInfo.md) | Array of detailed error cause information | [optional] +**request_id** | **str** | Unique identifier for the API request | [optional] + +## Example + +```python +from scm.mobile_agent.models.generic_error import GenericError + +# TODO update the JSON string below +json = "{}" +# create an instance of GenericError from a JSON string +generic_error_instance = GenericError.from_json(json) +# print the JSON string representation of the object +print(GenericError.to_json()) + +# convert the object into a dict +generic_error_dict = generic_error_instance.to_dict() +# create an instance of GenericError from a dict +generic_error_from_dict = GenericError.from_dict(generic_error_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/scm/mobile_agent/docs/GlobalProtectDestinationsListResponse.md b/scm/mobile_agent/docs/GlobalProtectDestinationsListResponse.md new file mode 100644 index 00000000..6793eefc --- /dev/null +++ b/scm/mobile_agent/docs/GlobalProtectDestinationsListResponse.md @@ -0,0 +1,32 @@ +# GlobalProtectDestinationsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ForwardingProfileDestinations]**](ForwardingProfileDestinations.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.mobile_agent.models.global_protect_destinations_list_response import GlobalProtectDestinationsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GlobalProtectDestinationsListResponse from a JSON string +global_protect_destinations_list_response_instance = GlobalProtectDestinationsListResponse.from_json(json) +# print the JSON string representation of the object +print(GlobalProtectDestinationsListResponse.to_json()) + +# convert the object into a dict +global_protect_destinations_list_response_dict = global_protect_destinations_list_response_instance.to_dict() +# create an instance of GlobalProtectDestinationsListResponse from a dict +global_protect_destinations_list_response_from_dict = GlobalProtectDestinationsListResponse.from_dict(global_protect_destinations_list_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/scm/mobile_agent/docs/GlobalProtectForwardingProfilesListResponse.md b/scm/mobile_agent/docs/GlobalProtectForwardingProfilesListResponse.md new file mode 100644 index 00000000..c8d9734d --- /dev/null +++ b/scm/mobile_agent/docs/GlobalProtectForwardingProfilesListResponse.md @@ -0,0 +1,32 @@ +# GlobalProtectForwardingProfilesListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ForwardingProfiles]**](ForwardingProfiles.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.mobile_agent.models.global_protect_forwarding_profiles_list_response import GlobalProtectForwardingProfilesListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GlobalProtectForwardingProfilesListResponse from a JSON string +global_protect_forwarding_profiles_list_response_instance = GlobalProtectForwardingProfilesListResponse.from_json(json) +# print the JSON string representation of the object +print(GlobalProtectForwardingProfilesListResponse.to_json()) + +# convert the object into a dict +global_protect_forwarding_profiles_list_response_dict = global_protect_forwarding_profiles_list_response_instance.to_dict() +# create an instance of GlobalProtectForwardingProfilesListResponse from a dict +global_protect_forwarding_profiles_list_response_from_dict = GlobalProtectForwardingProfilesListResponse.from_dict(global_protect_forwarding_profiles_list_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/scm/mobile_agent/docs/GlobalProtectRegionalAndCustomProxiesListResponse.md b/scm/mobile_agent/docs/GlobalProtectRegionalAndCustomProxiesListResponse.md new file mode 100644 index 00000000..74f54fed --- /dev/null +++ b/scm/mobile_agent/docs/GlobalProtectRegionalAndCustomProxiesListResponse.md @@ -0,0 +1,32 @@ +# GlobalProtectRegionalAndCustomProxiesListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ForwardingProfileRegionalAndCustomProxies]**](ForwardingProfileRegionalAndCustomProxies.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.mobile_agent.models.global_protect_regional_and_custom_proxies_list_response import GlobalProtectRegionalAndCustomProxiesListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GlobalProtectRegionalAndCustomProxiesListResponse from a JSON string +global_protect_regional_and_custom_proxies_list_response_instance = GlobalProtectRegionalAndCustomProxiesListResponse.from_json(json) +# print the JSON string representation of the object +print(GlobalProtectRegionalAndCustomProxiesListResponse.to_json()) + +# convert the object into a dict +global_protect_regional_and_custom_proxies_list_response_dict = global_protect_regional_and_custom_proxies_list_response_instance.to_dict() +# create an instance of GlobalProtectRegionalAndCustomProxiesListResponse from a dict +global_protect_regional_and_custom_proxies_list_response_from_dict = GlobalProtectRegionalAndCustomProxiesListResponse.from_dict(global_protect_regional_and_custom_proxies_list_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/scm/mobile_agent/docs/GlobalProtectSourceApplicationsListResponse.md b/scm/mobile_agent/docs/GlobalProtectSourceApplicationsListResponse.md new file mode 100644 index 00000000..ccf879ed --- /dev/null +++ b/scm/mobile_agent/docs/GlobalProtectSourceApplicationsListResponse.md @@ -0,0 +1,32 @@ +# GlobalProtectSourceApplicationsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ForwardingProfileSourceApplications]**](ForwardingProfileSourceApplications.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.mobile_agent.models.global_protect_source_applications_list_response import GlobalProtectSourceApplicationsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GlobalProtectSourceApplicationsListResponse from a JSON string +global_protect_source_applications_list_response_instance = GlobalProtectSourceApplicationsListResponse.from_json(json) +# print the JSON string representation of the object +print(GlobalProtectSourceApplicationsListResponse.to_json()) + +# convert the object into a dict +global_protect_source_applications_list_response_dict = global_protect_source_applications_list_response_instance.to_dict() +# create an instance of GlobalProtectSourceApplicationsListResponse from a dict +global_protect_source_applications_list_response_from_dict = GlobalProtectSourceApplicationsListResponse.from_dict(global_protect_source_applications_list_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/scm/mobile_agent/docs/GlobalProtectUserLocationsListResponse.md b/scm/mobile_agent/docs/GlobalProtectUserLocationsListResponse.md new file mode 100644 index 00000000..3a3bbd97 --- /dev/null +++ b/scm/mobile_agent/docs/GlobalProtectUserLocationsListResponse.md @@ -0,0 +1,32 @@ +# GlobalProtectUserLocationsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ForwardingProfileUserLocations]**](ForwardingProfileUserLocations.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.mobile_agent.models.global_protect_user_locations_list_response import GlobalProtectUserLocationsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of GlobalProtectUserLocationsListResponse from a JSON string +global_protect_user_locations_list_response_instance = GlobalProtectUserLocationsListResponse.from_json(json) +# print the JSON string representation of the object +print(GlobalProtectUserLocationsListResponse.to_json()) + +# convert the object into a dict +global_protect_user_locations_list_response_dict = global_protect_user_locations_list_response_instance.to_dict() +# create an instance of GlobalProtectUserLocationsListResponse from a dict +global_protect_user_locations_list_response_from_dict = GlobalProtectUserLocationsListResponse.from_dict(global_protect_user_locations_list_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/scm/mobile_agent/docs/RegionalAndCustomProxiesApi.md b/scm/mobile_agent/docs/RegionalAndCustomProxiesApi.md new file mode 100644 index 00000000..4b77021b --- /dev/null +++ b/scm/mobile_agent/docs/RegionalAndCustomProxiesApi.md @@ -0,0 +1,437 @@ +# scm.mobile_agent.RegionalAndCustomProxiesApi + +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/mobile-agent/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_global_protect_regional_and_custom_proxies**](RegionalAndCustomProxiesApi.md#create_global_protect_regional_and_custom_proxies) | **POST** /forwarding-profile-regional-and-custom-proxies | Create a GlobalProtect regional and custom proxy +[**delete_global_protect_regional_and_custom_proxies**](RegionalAndCustomProxiesApi.md#delete_global_protect_regional_and_custom_proxies) | **DELETE** /forwarding-profile-regional-and-custom-proxies/{id} | Delete a GlobalProtect regional and custom proxy +[**get_global_protect_regional_and_custom_proxy_by_id**](RegionalAndCustomProxiesApi.md#get_global_protect_regional_and_custom_proxy_by_id) | **GET** /forwarding-profile-regional-and-custom-proxies/{id} | Get a GlobalProtect regional and custom proxy +[**list_global_protect_regional_and_custom_proxies**](RegionalAndCustomProxiesApi.md#list_global_protect_regional_and_custom_proxies) | **GET** /forwarding-profile-regional-and-custom-proxies | List GlobalProtect regional and custom proxies +[**update_global_protect_regional_and_custom_proxy_by_id**](RegionalAndCustomProxiesApi.md#update_global_protect_regional_and_custom_proxy_by_id) | **PUT** /forwarding-profile-regional-and-custom-proxies/{id} | Update a GlobalProtect regional and custom proxy + + +# **create_global_protect_regional_and_custom_proxies** +> ForwardingProfileRegionalAndCustomProxies create_global_protect_regional_and_custom_proxies(folder=folder, forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies) + +Create a GlobalProtect regional and custom proxy + +Create a new GlobalProtect regional and custom proxy + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.RegionalAndCustomProxiesApi(api_client) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + forwarding_profile_regional_and_custom_proxies = scm.mobile_agent.ForwardingProfileRegionalAndCustomProxies() # ForwardingProfileRegionalAndCustomProxies | Created (optional) + + try: + # Create a GlobalProtect regional and custom proxy + api_response = api_instance.create_global_protect_regional_and_custom_proxies(folder=folder, forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies) + print("The response of RegionalAndCustomProxiesApi->create_global_protect_regional_and_custom_proxies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RegionalAndCustomProxiesApi->create_global_protect_regional_and_custom_proxies: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **folder** | **str**| The folder in which the resource is defined | [optional] + **forwarding_profile_regional_and_custom_proxies** | [**ForwardingProfileRegionalAndCustomProxies**](ForwardingProfileRegionalAndCustomProxies.md)| Created | [optional] + +### Return type + +[**ForwardingProfileRegionalAndCustomProxies**](ForwardingProfileRegionalAndCustomProxies.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_regional_and_custom_proxies** +> delete_global_protect_regional_and_custom_proxies(id) + +Delete a GlobalProtect regional and custom proxy + +Delete a GlobalProtect regional and custom proxy + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.RegionalAndCustomProxiesApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Delete a GlobalProtect regional and custom proxy + api_instance.delete_global_protect_regional_and_custom_proxies(id) + except Exception as e: + print("Exception when calling RegionalAndCustomProxiesApi->delete_global_protect_regional_and_custom_proxies: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +void (empty response body) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_regional_and_custom_proxy_by_id** +> ForwardingProfileRegionalAndCustomProxies get_global_protect_regional_and_custom_proxy_by_id(id) + +Get a GlobalProtect regional and custom proxy + +Retrieve an existing GlobalProtect regional and custom proxy + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.RegionalAndCustomProxiesApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Get a GlobalProtect regional and custom proxy + api_response = api_instance.get_global_protect_regional_and_custom_proxy_by_id(id) + print("The response of RegionalAndCustomProxiesApi->get_global_protect_regional_and_custom_proxy_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RegionalAndCustomProxiesApi->get_global_protect_regional_and_custom_proxy_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +[**ForwardingProfileRegionalAndCustomProxies**](ForwardingProfileRegionalAndCustomProxies.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_regional_and_custom_proxies** +> GlobalProtectRegionalAndCustomProxiesListResponse list_global_protect_regional_and_custom_proxies(name=name, limit=limit, offset=offset, folder=folder) + +List GlobalProtect regional and custom proxies + +Retrieve a list of GlobalProtect regional and custom proxies + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.global_protect_regional_and_custom_proxies_list_response import GlobalProtectRegionalAndCustomProxiesListResponse +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.RegionalAndCustomProxiesApi(api_client) + name = 'name_example' # str | The name of the configuration resource (optional) + limit = 200 # int | The maximum number of results per page (optional) (default to 200) + offset = 0 # int | The offset into the list of results returned (optional) (default to 0) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + + try: + # List GlobalProtect regional and custom proxies + api_response = api_instance.list_global_protect_regional_and_custom_proxies(name=name, limit=limit, offset=offset, folder=folder) + print("The response of RegionalAndCustomProxiesApi->list_global_protect_regional_and_custom_proxies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RegionalAndCustomProxiesApi->list_global_protect_regional_and_custom_proxies: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the configuration resource | [optional] + **limit** | **int**| The maximum number of results per page | [optional] [default to 200] + **offset** | **int**| The offset into the list of results returned | [optional] [default to 0] + **folder** | **str**| The folder in which the resource is defined | [optional] + +### Return type + +[**GlobalProtectRegionalAndCustomProxiesListResponse**](GlobalProtectRegionalAndCustomProxiesListResponse.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_regional_and_custom_proxy_by_id** +> ForwardingProfileRegionalAndCustomProxies update_global_protect_regional_and_custom_proxy_by_id(id, forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies) + +Update a GlobalProtect regional and custom proxy + +Update an existing GlobalProtect regional and custom proxy + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.RegionalAndCustomProxiesApi(api_client) + id = 'id_example' # str | The UUID of the resource + forwarding_profile_regional_and_custom_proxies = scm.mobile_agent.ForwardingProfileRegionalAndCustomProxies() # ForwardingProfileRegionalAndCustomProxies | The regional and custom proxy resource definition (optional) + + try: + # Update a GlobalProtect regional and custom proxy + api_response = api_instance.update_global_protect_regional_and_custom_proxy_by_id(id, forwarding_profile_regional_and_custom_proxies=forwarding_profile_regional_and_custom_proxies) + print("The response of RegionalAndCustomProxiesApi->update_global_protect_regional_and_custom_proxy_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RegionalAndCustomProxiesApi->update_global_protect_regional_and_custom_proxy_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + **forwarding_profile_regional_and_custom_proxies** | [**ForwardingProfileRegionalAndCustomProxies**](ForwardingProfileRegionalAndCustomProxies.md)| The regional and custom proxy resource definition | [optional] + +### Return type + +[**ForwardingProfileRegionalAndCustomProxies**](ForwardingProfileRegionalAndCustomProxies.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/mobile_agent/docs/SourceApplicationsApi.md b/scm/mobile_agent/docs/SourceApplicationsApi.md new file mode 100644 index 00000000..8a9f7ce9 --- /dev/null +++ b/scm/mobile_agent/docs/SourceApplicationsApi.md @@ -0,0 +1,437 @@ +# scm.mobile_agent.SourceApplicationsApi + +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/mobile-agent/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_global_protect_source_application**](SourceApplicationsApi.md#create_global_protect_source_application) | **POST** /forwarding-profile-source-applications | Create a GlobalProtect source application +[**delete_global_protect_source_application**](SourceApplicationsApi.md#delete_global_protect_source_application) | **DELETE** /forwarding-profile-source-applications/{id} | Delete a GlobalProtect source application +[**get_global_protect_source_application_by_id**](SourceApplicationsApi.md#get_global_protect_source_application_by_id) | **GET** /forwarding-profile-source-applications/{id} | Get a GlobalProtect source application +[**list_global_protect_source_applications**](SourceApplicationsApi.md#list_global_protect_source_applications) | **GET** /forwarding-profile-source-applications | List GlobalProtect source applications +[**update_global_protect_source_application_by_id**](SourceApplicationsApi.md#update_global_protect_source_application_by_id) | **PUT** /forwarding-profile-source-applications/{id} | Update a GlobalProtect source application + + +# **create_global_protect_source_application** +> ForwardingProfileSourceApplications create_global_protect_source_application(folder=folder, forwarding_profile_source_applications=forwarding_profile_source_applications) + +Create a GlobalProtect source application + +Create a new GlobalProtect source application + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.SourceApplicationsApi(api_client) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + forwarding_profile_source_applications = scm.mobile_agent.ForwardingProfileSourceApplications() # ForwardingProfileSourceApplications | Created (optional) + + try: + # Create a GlobalProtect source application + api_response = api_instance.create_global_protect_source_application(folder=folder, forwarding_profile_source_applications=forwarding_profile_source_applications) + print("The response of SourceApplicationsApi->create_global_protect_source_application:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SourceApplicationsApi->create_global_protect_source_application: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **folder** | **str**| The folder in which the resource is defined | [optional] + **forwarding_profile_source_applications** | [**ForwardingProfileSourceApplications**](ForwardingProfileSourceApplications.md)| Created | [optional] + +### Return type + +[**ForwardingProfileSourceApplications**](ForwardingProfileSourceApplications.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_source_application** +> delete_global_protect_source_application(id) + +Delete a GlobalProtect source application + +Delete a GlobalProtect source application + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.SourceApplicationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Delete a GlobalProtect source application + api_instance.delete_global_protect_source_application(id) + except Exception as e: + print("Exception when calling SourceApplicationsApi->delete_global_protect_source_application: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +void (empty response body) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_source_application_by_id** +> ForwardingProfileSourceApplications get_global_protect_source_application_by_id(id) + +Get a GlobalProtect source application + +Retrieve an existing GlobalProtect source application + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.SourceApplicationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Get a GlobalProtect source application + api_response = api_instance.get_global_protect_source_application_by_id(id) + print("The response of SourceApplicationsApi->get_global_protect_source_application_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SourceApplicationsApi->get_global_protect_source_application_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +[**ForwardingProfileSourceApplications**](ForwardingProfileSourceApplications.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_source_applications** +> GlobalProtectSourceApplicationsListResponse list_global_protect_source_applications(name=name, limit=limit, offset=offset, folder=folder) + +List GlobalProtect source applications + +Retrieve a list of GlobalProtect source applications + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.global_protect_source_applications_list_response import GlobalProtectSourceApplicationsListResponse +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.SourceApplicationsApi(api_client) + name = 'name_example' # str | The name of the configuration resource (optional) + limit = 200 # int | The maximum number of results per page (optional) (default to 200) + offset = 0 # int | The offset into the list of results returned (optional) (default to 0) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + + try: + # List GlobalProtect source applications + api_response = api_instance.list_global_protect_source_applications(name=name, limit=limit, offset=offset, folder=folder) + print("The response of SourceApplicationsApi->list_global_protect_source_applications:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SourceApplicationsApi->list_global_protect_source_applications: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the configuration resource | [optional] + **limit** | **int**| The maximum number of results per page | [optional] [default to 200] + **offset** | **int**| The offset into the list of results returned | [optional] [default to 0] + **folder** | **str**| The folder in which the resource is defined | [optional] + +### Return type + +[**GlobalProtectSourceApplicationsListResponse**](GlobalProtectSourceApplicationsListResponse.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_source_application_by_id** +> ForwardingProfileSourceApplications update_global_protect_source_application_by_id(id, forwarding_profile_source_applications=forwarding_profile_source_applications) + +Update a GlobalProtect source application + +Update an existing GlobalProtect source application + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.SourceApplicationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + forwarding_profile_source_applications = scm.mobile_agent.ForwardingProfileSourceApplications() # ForwardingProfileSourceApplications | The source application resource definition (optional) + + try: + # Update a GlobalProtect source application + api_response = api_instance.update_global_protect_source_application_by_id(id, forwarding_profile_source_applications=forwarding_profile_source_applications) + print("The response of SourceApplicationsApi->update_global_protect_source_application_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SourceApplicationsApi->update_global_protect_source_application_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + **forwarding_profile_source_applications** | [**ForwardingProfileSourceApplications**](ForwardingProfileSourceApplications.md)| The source application resource definition | [optional] + +### Return type + +[**ForwardingProfileSourceApplications**](ForwardingProfileSourceApplications.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/mobile_agent/docs/UserLocationsApi.md b/scm/mobile_agent/docs/UserLocationsApi.md new file mode 100644 index 00000000..9d0d4916 --- /dev/null +++ b/scm/mobile_agent/docs/UserLocationsApi.md @@ -0,0 +1,437 @@ +# scm.mobile_agent.UserLocationsApi + +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/mobile-agent/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_global_protect_user_location**](UserLocationsApi.md#create_global_protect_user_location) | **POST** /forwarding-profile-user-locations | Create a GlobalProtect user location +[**delete_global_protect_user_location**](UserLocationsApi.md#delete_global_protect_user_location) | **DELETE** /forwarding-profile-user-locations/{id} | Delete a GlobalProtect user location +[**get_global_protect_user_location_by_id**](UserLocationsApi.md#get_global_protect_user_location_by_id) | **GET** /forwarding-profile-user-locations/{id} | Get a GlobalProtect user location +[**list_global_protect_user_locations**](UserLocationsApi.md#list_global_protect_user_locations) | **GET** /forwarding-profile-user-locations | List GlobalProtect user locations +[**update_global_protect_user_location_by_id**](UserLocationsApi.md#update_global_protect_user_location_by_id) | **PUT** /forwarding-profile-user-locations/{id} | Update a GlobalProtect user location + + +# **create_global_protect_user_location** +> ForwardingProfileUserLocations create_global_protect_user_location(folder=folder, forwarding_profile_user_locations=forwarding_profile_user_locations) + +Create a GlobalProtect user location + +Create a new GlobalProtect user location + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.UserLocationsApi(api_client) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + forwarding_profile_user_locations = scm.mobile_agent.ForwardingProfileUserLocations() # ForwardingProfileUserLocations | Created (optional) + + try: + # Create a GlobalProtect user location + api_response = api_instance.create_global_protect_user_location(folder=folder, forwarding_profile_user_locations=forwarding_profile_user_locations) + print("The response of UserLocationsApi->create_global_protect_user_location:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UserLocationsApi->create_global_protect_user_location: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **folder** | **str**| The folder in which the resource is defined | [optional] + **forwarding_profile_user_locations** | [**ForwardingProfileUserLocations**](ForwardingProfileUserLocations.md)| Created | [optional] + +### Return type + +[**ForwardingProfileUserLocations**](ForwardingProfileUserLocations.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_user_location** +> delete_global_protect_user_location(id) + +Delete a GlobalProtect user location + +Delete a GlobalProtect user location + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.UserLocationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Delete a GlobalProtect user location + api_instance.delete_global_protect_user_location(id) + except Exception as e: + print("Exception when calling UserLocationsApi->delete_global_protect_user_location: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +void (empty response body) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[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_global_protect_user_location_by_id** +> ForwardingProfileUserLocations get_global_protect_user_location_by_id(id) + +Get a GlobalProtect user location + +Retrieve an existing GlobalProtect user location + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.UserLocationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + + try: + # Get a GlobalProtect user location + api_response = api_instance.get_global_protect_user_location_by_id(id) + print("The response of UserLocationsApi->get_global_protect_user_location_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UserLocationsApi->get_global_protect_user_location_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + +### Return type + +[**ForwardingProfileUserLocations**](ForwardingProfileUserLocations.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_user_locations** +> GlobalProtectUserLocationsListResponse list_global_protect_user_locations(name=name, limit=limit, offset=offset, folder=folder) + +List GlobalProtect user locations + +Retrieve a list of GlobalProtect user locations + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.global_protect_user_locations_list_response import GlobalProtectUserLocationsListResponse +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.UserLocationsApi(api_client) + name = 'name_example' # str | The name of the configuration resource (optional) + limit = 200 # int | The maximum number of results per page (optional) (default to 200) + offset = 0 # int | The offset into the list of results returned (optional) (default to 0) + folder = 'folder_example' # str | The folder in which the resource is defined (optional) + + try: + # List GlobalProtect user locations + api_response = api_instance.list_global_protect_user_locations(name=name, limit=limit, offset=offset, folder=folder) + print("The response of UserLocationsApi->list_global_protect_user_locations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UserLocationsApi->list_global_protect_user_locations: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| The name of the configuration resource | [optional] + **limit** | **int**| The maximum number of results per page | [optional] [default to 200] + **offset** | **int**| The offset into the list of results returned | [optional] [default to 0] + **folder** | **str**| The folder in which the resource is defined | [optional] + +### Return type + +[**GlobalProtectUserLocationsListResponse**](GlobalProtectUserLocationsListResponse.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**0** | General Errors | - | + +[[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_global_protect_user_location_by_id** +> ForwardingProfileUserLocations update_global_protect_user_location_by_id(id, forwarding_profile_user_locations=forwarding_profile_user_locations) + +Update a GlobalProtect user location + +Update an existing GlobalProtect user location + +### Example + +* Bearer (JWT) Authentication (scmToken): + +```python +import scm.mobile_agent +from scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from scm.mobile_agent.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/mobile-agent/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.mobile_agent.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/mobile-agent/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): scmToken +configuration = scm.mobile_agent.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.mobile_agent.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.mobile_agent.UserLocationsApi(api_client) + id = 'id_example' # str | The UUID of the resource + forwarding_profile_user_locations = scm.mobile_agent.ForwardingProfileUserLocations() # ForwardingProfileUserLocations | The user location resource definition (optional) + + try: + # Update a GlobalProtect user location + api_response = api_instance.update_global_protect_user_location_by_id(id, forwarding_profile_user_locations=forwarding_profile_user_locations) + print("The response of UserLocationsApi->update_global_protect_user_location_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling UserLocationsApi->update_global_protect_user_location_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| The UUID of the resource | + **forwarding_profile_user_locations** | [**ForwardingProfileUserLocations**](ForwardingProfileUserLocations.md)| The user location resource definition | [optional] + +### Return type + +[**ForwardingProfileUserLocations**](ForwardingProfileUserLocations.md) + +### Authorization + +[scmToken](../README.md#scmToken) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | +**0** | General Errors | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/mobile_agent/exceptions.py b/scm/mobile_agent/exceptions.py new file mode 100644 index 00000000..fbc53802 --- /dev/null +++ b/scm/mobile_agent/exceptions.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/scm/mobile_agent/models/__init__.py b/scm/mobile_agent/models/__init__.py new file mode 100644 index 00000000..1abab975 --- /dev/null +++ b/scm/mobile_agent/models/__init__.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +# flake8: noqa +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from scm.mobile_agent.models.block_rule_basic import BlockRuleBasic +from scm.mobile_agent.models.block_rule_basic_allow_tcp import BlockRuleBasicAllowTcp +from scm.mobile_agent.models.block_rule_basic_allow_udp import BlockRuleBasicAllowUdp +from scm.mobile_agent.models.block_rule_ztna import BlockRuleZtna +from scm.mobile_agent.models.error_detail_cause_info import ErrorDetailCauseInfo +from scm.mobile_agent.models.forwarding_profile_destination_fqdn_entry import ForwardingProfileDestinationFqdnEntry +from scm.mobile_agent.models.forwarding_profile_destination_ip_entry import ForwardingProfileDestinationIpEntry +from scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy import ForwardingProfileGlobalProtectProxy +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy_global_protect_proxy import ForwardingProfileGlobalProtectProxyGlobalProtectProxy +from scm.mobile_agent.models.forwarding_profile_pac_file import ForwardingProfilePacFile +from scm.mobile_agent.models.forwarding_profile_pac_file_pac_file import ForwardingProfilePacFilePacFile +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner import ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner import ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy1 import ForwardingProfileRegionalAndCustomProxiesProxy1 +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy2 import ForwardingProfileRegionalAndCustomProxiesProxy2 +from scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from scm.mobile_agent.models.forwarding_profile_user_locations_internal_host_detection import ForwardingProfileUserLocationsInternalHostDetection +from scm.mobile_agent.models.forwarding_profile_ztna_agent import ForwardingProfileZtnaAgent +from scm.mobile_agent.models.forwarding_profile_ztna_agent_ztna_agent import ForwardingProfileZtnaAgentZtnaAgent +from scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from scm.mobile_agent.models.forwarding_profiles_type import ForwardingProfilesType +from scm.mobile_agent.models.forwarding_rule_basic import ForwardingRuleBasic +from scm.mobile_agent.models.forwarding_rule_ztna import ForwardingRuleZtna +from scm.mobile_agent.models.generic_error import GenericError +from scm.mobile_agent.models.global_protect_destinations_list_response import GlobalProtectDestinationsListResponse +from scm.mobile_agent.models.global_protect_forwarding_profiles_list_response import GlobalProtectForwardingProfilesListResponse +from scm.mobile_agent.models.global_protect_regional_and_custom_proxies_list_response import GlobalProtectRegionalAndCustomProxiesListResponse +from scm.mobile_agent.models.global_protect_source_applications_list_response import GlobalProtectSourceApplicationsListResponse +from scm.mobile_agent.models.global_protect_user_locations_list_response import GlobalProtectUserLocationsListResponse diff --git a/scm/mobile_agent/models/block_rule_basic.py b/scm/mobile_agent/models/block_rule_basic.py new file mode 100644 index 00000000..c30e18c5 --- /dev/null +++ b/scm/mobile_agent/models/block_rule_basic.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.block_rule_basic_allow_tcp import BlockRuleBasicAllowTcp +from scm.mobile_agent.models.block_rule_basic_allow_udp import BlockRuleBasicAllowUdp +from typing import Optional, Set +from typing_extensions import Self + +class BlockRuleBasic(BaseModel): + """ + Basic block rule configuration for PAC file and GlobalProtect proxy profiles + """ # noqa: E501 + allow_tcp: Optional[BlockRuleBasicAllowTcp] = None + allow_udp: Optional[BlockRuleBasicAllowUdp] = None + enable: Optional[StrictBool] = Field(default=None, description="Enable block rule") + __properties: ClassVar[List[str]] = ["allow_tcp", "allow_udp", "enable"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BlockRuleBasic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 allow_tcp + if self.allow_tcp: + _dict['allow_tcp'] = self.allow_tcp.to_dict() + # override the default output from pydantic by calling `to_dict()` of allow_udp + if self.allow_udp: + _dict['allow_udp'] = self.allow_udp.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BlockRuleBasic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_tcp": BlockRuleBasicAllowTcp.from_dict(obj["allow_tcp"]) if obj.get("allow_tcp") is not None else None, + "allow_udp": BlockRuleBasicAllowUdp.from_dict(obj["allow_udp"]) if obj.get("allow_udp") is not None else None, + "enable": obj.get("enable") + }) + return _obj + + diff --git a/scm/mobile_agent/models/block_rule_basic_allow_tcp.py b/scm/mobile_agent/models/block_rule_basic_allow_tcp.py new file mode 100644 index 00000000..e087ba3d --- /dev/null +++ b/scm/mobile_agent/models/block_rule_basic_allow_tcp.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 typing import Optional, Set +from typing_extensions import Self + +class BlockRuleBasicAllowTcp(BaseModel): + """ + TCP traffic allowlist configuration + """ # noqa: E501 + enable_locations: Optional[StrictBool] = Field(default=None, description="Enable locations for allow-tcp") + locations: Optional[List[Annotated[str, Field(strict=True, max_length=64)]]] = Field(default=None, description="List of user locations allowed for TCP traffic") + __properties: ClassVar[List[str]] = ["enable_locations", "locations"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BlockRuleBasicAllowTcp from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 BlockRuleBasicAllowTcp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enable_locations": obj.get("enable_locations"), + "locations": obj.get("locations") + }) + return _obj + + diff --git a/scm/mobile_agent/models/block_rule_basic_allow_udp.py b/scm/mobile_agent/models/block_rule_basic_allow_udp.py new file mode 100644 index 00000000..48b36440 --- /dev/null +++ b/scm/mobile_agent/models/block_rule_basic_allow_udp.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 typing import Optional, Set +from typing_extensions import Self + +class BlockRuleBasicAllowUdp(BaseModel): + """ + UDP traffic allowlist configuration with location and destination support + """ # noqa: E501 + destinations: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="Destination addresses or networks allowed for UDP traffic") + enable_destinations: Optional[StrictBool] = Field(default=None, description="Enable destinations for allow-udp") + enable_locations: Optional[StrictBool] = Field(default=None, description="Enable locations for allow-udp") + locations: Optional[List[Annotated[str, Field(strict=True, max_length=64)]]] = Field(default=None, description="List of user locations allowed for UDP traffic") + __properties: ClassVar[List[str]] = ["destinations", "enable_destinations", "enable_locations", "locations"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BlockRuleBasicAllowUdp from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 BlockRuleBasicAllowUdp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "destinations": obj.get("destinations"), + "enable_destinations": obj.get("enable_destinations"), + "enable_locations": obj.get("enable_locations"), + "locations": obj.get("locations") + }) + return _obj + + diff --git a/scm/mobile_agent/models/block_rule_ztna.py b/scm/mobile_agent/models/block_rule_ztna.py new file mode 100644 index 00000000..3004e5a0 --- /dev/null +++ b/scm/mobile_agent/models/block_rule_ztna.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 import Optional, Set +from typing_extensions import Self + +class BlockRuleZtna(BaseModel): + """ + ZTNA block rule configuration + """ # noqa: E501 + allow_icmp_for_troubleshooting: Optional[StrictBool] = Field(default=False, description="Allow ICMP for troubleshooting") + block_all_other_unmatched_outbound_connections: Optional[StrictBool] = Field(default=False, description="Block all other unmatched outbound connections") + block_inbound_access_when_connected_to_tunnel: Optional[StrictBool] = Field(default=False, description="Block inbound access when connected to tunnel") + block_non_tcp_non_udp_traffic_when_connected_to_tunnel: Optional[StrictBool] = Field(default=False, description="Block Non-TCP Non UDP based traffic when connected to tunnel") + block_outbound_lan_access_when_connected_to_tunnel: Optional[StrictBool] = Field(default=False, description="Block outbound LAN access when connected to tunnel") + enforcer_fqdn_dns_resolution_via_dns_servers: Optional[StrictBool] = Field(default=True, description="Enforce FQDN DNS resolution via tunnel DNS servers") + resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel: Optional[StrictBool] = Field(default=True, description="Resolve All FQDNs using DNS servers assigned by the tunnel (Windows Only)") + __properties: ClassVar[List[str]] = ["allow_icmp_for_troubleshooting", "block_all_other_unmatched_outbound_connections", "block_inbound_access_when_connected_to_tunnel", "block_non_tcp_non_udp_traffic_when_connected_to_tunnel", "block_outbound_lan_access_when_connected_to_tunnel", "enforcer_fqdn_dns_resolution_via_dns_servers", "resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BlockRuleZtna from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 BlockRuleZtna from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "allow_icmp_for_troubleshooting": obj.get("allow_icmp_for_troubleshooting") if obj.get("allow_icmp_for_troubleshooting") is not None else False, + "block_all_other_unmatched_outbound_connections": obj.get("block_all_other_unmatched_outbound_connections") if obj.get("block_all_other_unmatched_outbound_connections") is not None else False, + "block_inbound_access_when_connected_to_tunnel": obj.get("block_inbound_access_when_connected_to_tunnel") if obj.get("block_inbound_access_when_connected_to_tunnel") is not None else False, + "block_non_tcp_non_udp_traffic_when_connected_to_tunnel": obj.get("block_non_tcp_non_udp_traffic_when_connected_to_tunnel") if obj.get("block_non_tcp_non_udp_traffic_when_connected_to_tunnel") is not None else False, + "block_outbound_lan_access_when_connected_to_tunnel": obj.get("block_outbound_lan_access_when_connected_to_tunnel") if obj.get("block_outbound_lan_access_when_connected_to_tunnel") is not None else False, + "enforcer_fqdn_dns_resolution_via_dns_servers": obj.get("enforcer_fqdn_dns_resolution_via_dns_servers") if obj.get("enforcer_fqdn_dns_resolution_via_dns_servers") is not None else True, + "resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel": obj.get("resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel") if obj.get("resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel") is not None else True + }) + return _obj + + diff --git a/scm/mobile_agent/models/error_detail_cause_info.py b/scm/mobile_agent/models/error_detail_cause_info.py new file mode 100644 index 00000000..20af794e --- /dev/null +++ b/scm/mobile_agent/models/error_detail_cause_info.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 ErrorDetailCauseInfo(BaseModel): + """ + Detailed information about an error cause including code, message, and contextual details + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="Error code identifying the type of error") + details: Optional[Any] = Field(default=None, description="Additional error details as string or structured object") + help: Optional[StrictStr] = Field(default=None, description="Help text for resolving the error") + message: Optional[StrictStr] = Field(default=None, description="Human-readable error message") + __properties: ClassVar[List[str]] = ["code", "details", "help", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorDetailCauseInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if details (nullable) is None + # and model_fields_set contains the field + if self.details is None and "details" in self.model_fields_set: + _dict['details'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorDetailCauseInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "details": obj.get("details"), + "help": obj.get("help"), + "message": obj.get("message") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_destination_fqdn_entry.py b/scm/mobile_agent/models/forwarding_profile_destination_fqdn_entry.py new file mode 100644 index 00000000..117e930e --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_destination_fqdn_entry.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, 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 ForwardingProfileDestinationFqdnEntry(BaseModel): + """ + FQDN entry destination + """ # noqa: E501 + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="alphanumeric string [*0-9a-zA-Z._-] and at most one $ by the end") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=None, description="Port number for fqdn based destination") + __properties: ClassVar[List[str]] = ["name", "port"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^([\*a-zA-Z0-9._-])+\$?$", value): + raise ValueError(r"must validate the regular expression /^([\*a-zA-Z0-9._-])+\$?$/") + 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 ForwardingProfileDestinationFqdnEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingProfileDestinationFqdnEntry 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"), + "port": obj.get("port") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_destination_ip_entry.py b/scm/mobile_agent/models/forwarding_profile_destination_ip_entry.py new file mode 100644 index 00000000..33869466 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_destination_ip_entry.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, 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 ForwardingProfileDestinationIpEntry(BaseModel): + """ + IP address entry destination + """ # noqa: E501 + name: Annotated[str, Field(strict=True)] = Field(description="IP address with wildcards and CIDR notation support") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=None, description="Port number for IP address based destination") + __properties: ClassVar[List[str]] = ["name", "port"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(((\*|(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2]?[0-9]))))$", value): + raise ValueError(r"must validate the regular expression /^(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(((\*|(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2]?[0-9]))))$/") + 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 ForwardingProfileDestinationIpEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingProfileDestinationIpEntry 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"), + "port": obj.get("port") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_destinations.py b/scm/mobile_agent/models/forwarding_profile_destinations.py new file mode 100644 index 00000000..e0457552 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_destinations.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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_extensions import Annotated +from scm.mobile_agent.models.forwarding_profile_destination_fqdn_entry import ForwardingProfileDestinationFqdnEntry +from scm.mobile_agent.models.forwarding_profile_destination_ip_entry import ForwardingProfileDestinationIpEntry +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileDestinations(BaseModel): + """ + ForwardingProfileDestinations + """ # noqa: E501 + description: Optional[Annotated[str, Field(strict=True, max_length=1023)]] = Field(default=None, description="description of the destination") + fqdn: Optional[List[ForwardingProfileDestinationFqdnEntry]] = Field(default=None, description="List of FQDN based destination entries") + id: Optional[StrictStr] = Field(default=None, description="The UUID of the destination") + ip_addresses: Optional[List[ForwardingProfileDestinationIpEntry]] = Field(default=None, description="List of IP address based destination entries") + name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="alphanumeric string [ 0-9a-zA-Z._ -]") + __properties: ClassVar[List[str]] = ["description", "fqdn", "id", "ip_addresses", "name"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-zA-Z._ -]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z._ -]+$/") + 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 ForwardingProfileDestinations from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _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 fqdn (list) + _items = [] + if self.fqdn: + for _item_fqdn in self.fqdn: + if _item_fqdn: + _items.append(_item_fqdn.to_dict()) + _dict['fqdn'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in ip_addresses (list) + _items = [] + if self.ip_addresses: + for _item_ip_addresses in self.ip_addresses: + if _item_ip_addresses: + _items.append(_item_ip_addresses.to_dict()) + _dict['ip_addresses'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfileDestinations from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "fqdn": [ForwardingProfileDestinationFqdnEntry.from_dict(_item) for _item in obj["fqdn"]] if obj.get("fqdn") is not None else None, + "id": obj.get("id"), + "ip_addresses": [ForwardingProfileDestinationIpEntry.from_dict(_item) for _item in obj["ip_addresses"]] if obj.get("ip_addresses") is not None else None, + "name": obj.get("name") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_global_protect_proxy.py b/scm/mobile_agent/models/forwarding_profile_global_protect_proxy.py new file mode 100644 index 00000000..baaec6ff --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_global_protect_proxy.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, Optional +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy_global_protect_proxy import ForwardingProfileGlobalProtectProxyGlobalProtectProxy +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileGlobalProtectProxy(BaseModel): + """ + GlobalProtect proxy-based forwarding profile configuration + """ # noqa: E501 + global_protect_proxy: Optional[ForwardingProfileGlobalProtectProxyGlobalProtectProxy] = None + __properties: ClassVar[List[str]] = ["global_protect_proxy"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ForwardingProfileGlobalProtectProxy from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 global_protect_proxy + if self.global_protect_proxy: + _dict['global_protect_proxy'] = self.global_protect_proxy.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfileGlobalProtectProxy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "global_protect_proxy": ForwardingProfileGlobalProtectProxyGlobalProtectProxy.from_dict(obj["global_protect_proxy"]) if obj.get("global_protect_proxy") is not None else None + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_global_protect_proxy_global_protect_proxy.py b/scm/mobile_agent/models/forwarding_profile_global_protect_proxy_global_protect_proxy.py new file mode 100644 index 00000000..a949a19c --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_global_protect_proxy_global_protect_proxy.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.block_rule_basic import BlockRuleBasic +from scm.mobile_agent.models.forwarding_rule_basic import ForwardingRuleBasic +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileGlobalProtectProxyGlobalProtectProxy(BaseModel): + """ + Global Protect proxy-based forwarding configuration + """ # noqa: E501 + block_rule: Optional[BlockRuleBasic] = None + forwarding_rules: Optional[List[ForwardingRuleBasic]] = Field(default=None, description="List of GlobalProtect proxy-based forwarding rules") + pac_upload: Optional[StrictBool] = Field(default=False, description="User uploaded PAC file for Global Protect proxy-based forwarding configuration") + __properties: ClassVar[List[str]] = ["block_rule", "forwarding_rules", "pac_upload"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ForwardingProfileGlobalProtectProxyGlobalProtectProxy from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 block_rule + if self.block_rule: + _dict['block_rule'] = self.block_rule.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in forwarding_rules (list) + _items = [] + if self.forwarding_rules: + for _item_forwarding_rules in self.forwarding_rules: + if _item_forwarding_rules: + _items.append(_item_forwarding_rules.to_dict()) + _dict['forwarding_rules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfileGlobalProtectProxyGlobalProtectProxy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "block_rule": BlockRuleBasic.from_dict(obj["block_rule"]) if obj.get("block_rule") is not None else None, + "forwarding_rules": [ForwardingRuleBasic.from_dict(_item) for _item in obj["forwarding_rules"]] if obj.get("forwarding_rules") is not None else None, + "pac_upload": obj.get("pac_upload") if obj.get("pac_upload") is not None else False + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_pac_file.py b/scm/mobile_agent/models/forwarding_profile_pac_file.py new file mode 100644 index 00000000..a9309f8c --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_pac_file.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, Optional +from scm.mobile_agent.models.forwarding_profile_pac_file_pac_file import ForwardingProfilePacFilePacFile +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfilePacFile(BaseModel): + """ + PAC file-based forwarding profile configuration + """ # noqa: E501 + pac_file: Optional[ForwardingProfilePacFilePacFile] = None + __properties: ClassVar[List[str]] = ["pac_file"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ForwardingProfilePacFile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 pac_file + if self.pac_file: + _dict['pac_file'] = self.pac_file.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfilePacFile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "pac_file": ForwardingProfilePacFilePacFile.from_dict(obj["pac_file"]) if obj.get("pac_file") is not None else None + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_pac_file_pac_file.py b/scm/mobile_agent/models/forwarding_profile_pac_file_pac_file.py new file mode 100644 index 00000000..b1c7a3de --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_pac_file_pac_file.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.block_rule_basic import BlockRuleBasic +from scm.mobile_agent.models.forwarding_rule_basic import ForwardingRuleBasic +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfilePacFilePacFile(BaseModel): + """ + PAC file based forwarding configuration + """ # noqa: E501 + block_rule: Optional[BlockRuleBasic] = None + forwarding_rules: Optional[List[ForwardingRuleBasic]] = Field(default=None, description="List of PAC file-based forwarding rules") + pac_upload: Optional[StrictBool] = Field(default=False, description="User upload PAC file for PAC file based forwarding configuration") + __properties: ClassVar[List[str]] = ["block_rule", "forwarding_rules", "pac_upload"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ForwardingProfilePacFilePacFile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 block_rule + if self.block_rule: + _dict['block_rule'] = self.block_rule.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in forwarding_rules (list) + _items = [] + if self.forwarding_rules: + for _item_forwarding_rules in self.forwarding_rules: + if _item_forwarding_rules: + _items.append(_item_forwarding_rules.to_dict()) + _dict['forwarding_rules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfilePacFilePacFile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "block_rule": BlockRuleBasic.from_dict(obj["block_rule"]) if obj.get("block_rule") is not None else None, + "forwarding_rules": [ForwardingRuleBasic.from_dict(_item) for _item in obj["forwarding_rules"]] if obj.get("forwarding_rules") is not None else None, + "pac_upload": obj.get("pac_upload") if obj.get("pac_upload") is not None else False + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies.py b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies.py new file mode 100644 index 00000000..4e916fef --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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_extensions import Annotated +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner import ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner import ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy1 import ForwardingProfileRegionalAndCustomProxiesProxy1 +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy2 import ForwardingProfileRegionalAndCustomProxiesProxy2 +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileRegionalAndCustomProxies(BaseModel): + """ + ForwardingProfileRegionalAndCustomProxies + """ # noqa: E501 + connectivity_preference: Optional[List[ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner]] = Field(default=None, description="List of connectivity methods and their enablement status for establishing proxy connections") + description: Optional[Annotated[str, Field(strict=True, max_length=1023)]] = Field(default=None, description="regional and custom proxy configuration description") + fallback_option: Optional[StrictStr] = Field(default=None, description="Behavior when proxy connection fails - 'fail-open' allows direct internet access, 'fail-safe' blocks traffic until proxy is restored") + id: Optional[StrictStr] = Field(default=None, description="The UUID of the regional and custom proxy") + location_preference: Optional[StrictStr] = Field(default=None, description="Strategy for selecting Prisma Access location - 'best-available-pa-location' automatically selects optimal location, 'specific-pa-location' uses predefined locations") + name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="alphanumeric string [ 0-9a-zA-Z ._-]") + prisma_access_locations: Optional[List[ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner]] = Field(default=None, description="Select Prisma Access location Americas, Europe and Asia-Pacific.") + proxy_1: Optional[ForwardingProfileRegionalAndCustomProxiesProxy1] = None + proxy_2: Optional[ForwardingProfileRegionalAndCustomProxiesProxy2] = None + type: Optional[StrictStr] = Field(default='gp-and-pac', description="Proxy configuration type - 'gp-and-pac' for GlobalProtect and PAC file forwarding, 'ztna-agent' for ZTNA agent forwarding") + __properties: ClassVar[List[str]] = ["connectivity_preference", "description", "fallback_option", "id", "location_preference", "name", "prisma_access_locations", "proxy_1", "proxy_2", "type"] + + @field_validator('fallback_option') + def fallback_option_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['fail-open', 'fail-safe']): + raise ValueError("must be one of enum values ('fail-open', 'fail-safe')") + return value + + @field_validator('location_preference') + def location_preference_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['best-available-pa-location', 'specific-pa-location']): + raise ValueError("must be one of enum values ('best-available-pa-location', 'specific-pa-location')") + return value + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-zA-Z ._-]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z ._-]+$/") + return value + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['gp-and-pac', 'ztna-agent']): + raise ValueError("must be one of enum values ('gp-and-pac', 'ztna-agent')") + 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 ForwardingProfileRegionalAndCustomProxies from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _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 connectivity_preference (list) + _items = [] + if self.connectivity_preference: + for _item_connectivity_preference in self.connectivity_preference: + if _item_connectivity_preference: + _items.append(_item_connectivity_preference.to_dict()) + _dict['connectivity_preference'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in prisma_access_locations (list) + _items = [] + if self.prisma_access_locations: + for _item_prisma_access_locations in self.prisma_access_locations: + if _item_prisma_access_locations: + _items.append(_item_prisma_access_locations.to_dict()) + _dict['prisma_access_locations'] = _items + # override the default output from pydantic by calling `to_dict()` of proxy_1 + if self.proxy_1: + _dict['proxy_1'] = self.proxy_1.to_dict() + # override the default output from pydantic by calling `to_dict()` of proxy_2 + if self.proxy_2: + _dict['proxy_2'] = self.proxy_2.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfileRegionalAndCustomProxies from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "connectivity_preference": [ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner.from_dict(_item) for _item in obj["connectivity_preference"]] if obj.get("connectivity_preference") is not None else None, + "description": obj.get("description"), + "fallback_option": obj.get("fallback_option"), + "id": obj.get("id"), + "location_preference": obj.get("location_preference"), + "name": obj.get("name"), + "prisma_access_locations": [ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner.from_dict(_item) for _item in obj["prisma_access_locations"]] if obj.get("prisma_access_locations") is not None else None, + "proxy_1": ForwardingProfileRegionalAndCustomProxiesProxy1.from_dict(obj["proxy_1"]) if obj.get("proxy_1") is not None else None, + "proxy_2": ForwardingProfileRegionalAndCustomProxiesProxy2.from_dict(obj["proxy_2"]) if obj.get("proxy_2") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'gp-and-pac' + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner.py b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner.py new file mode 100644 index 00000000..5436aaf7 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner(BaseModel): + """ + ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner + """ # noqa: E501 + enabled: Optional[StrictBool] = Field(default=False, description="Indicates whether this connectivity method is enabled for use in the proxy configuration") + name: StrictStr = Field(description="Connectivity method type - 'tunnel' for VPN tunnels, 'proxy' for HTTP/HTTPS proxies, 'adns' for authenticated DNS, 'masque' for MASQUE protocol") + __properties: ClassVar[List[str]] = ["enabled", "name"] + + @field_validator('name') + def name_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['tunnel', 'proxy', 'adns', 'masque']): + raise ValueError("must be one of enum values ('tunnel', 'proxy', 'adns', 'masque')") + 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 ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enabled": obj.get("enabled") if obj.get("enabled") is not None else False, + "name": obj.get("name") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner.py b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner.py new file mode 100644 index 00000000..efd2fe53 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, 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 ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner(BaseModel): + """ + ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner + """ # noqa: E501 + locations: Optional[List[Annotated[str, Field(strict=True, max_length=63)]]] = Field(default=None, description="Add list of locations separated by space, in that region") + name: Annotated[str, Field(strict=True)] = Field(description="One of the region from 'americas', 'europe', 'apac'") + __properties: ClassVar[List[str]] = ["locations", "name"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-Z]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z]+$/") + 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 ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "locations": obj.get("locations"), + "name": obj.get("name") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy1.py b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy1.py new file mode 100644 index 00000000..a6dca3fc --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy1.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileRegionalAndCustomProxiesProxy1(BaseModel): + """ + primary regional and custom proxy + """ # noqa: E501 + fqdn: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="fqdn of the primary proxy server (supports wildcards and alphanumeric characters with dots, hyphens, and underscores)") + location: Optional[StrictStr] = Field(default=None, description="Geographic or network location identifier for the primary proxy server") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=None, description="port number for primary proxy") + __properties: ClassVar[List[str]] = ["fqdn", "location", "port"] + + @field_validator('fqdn') + def fqdn_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^([\*a-zA-Z0-9._-])+$", value): + raise ValueError(r"must validate the regular expression /^([\*a-zA-Z0-9._-])+$/") + 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 ForwardingProfileRegionalAndCustomProxiesProxy1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingProfileRegionalAndCustomProxiesProxy1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fqdn": obj.get("fqdn"), + "location": obj.get("location"), + "port": obj.get("port") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy2.py b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy2.py new file mode 100644 index 00000000..09cee1f3 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_regional_and_custom_proxies_proxy2.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileRegionalAndCustomProxiesProxy2(BaseModel): + """ + secondary regional and custom proxy + """ # noqa: E501 + fqdn: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="Fqdn of the secondary (backup) proxy server used for failover scenarios") + location: Optional[StrictStr] = Field(default=None, description="Geographic or network location identifier for the secondary proxy server") + port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=None, description="port number for secondary proxy") + __properties: ClassVar[List[str]] = ["fqdn", "location", "port"] + + @field_validator('fqdn') + def fqdn_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^([\*a-zA-Z0-9._-])+$", value): + raise ValueError(r"must validate the regular expression /^([\*a-zA-Z0-9._-])+$/") + 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 ForwardingProfileRegionalAndCustomProxiesProxy2 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingProfileRegionalAndCustomProxiesProxy2 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fqdn": obj.get("fqdn"), + "location": obj.get("location"), + "port": obj.get("port") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_source_applications.py b/scm/mobile_agent/models/forwarding_profile_source_applications.py new file mode 100644 index 00000000..ff516474 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_source_applications.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileSourceApplications(BaseModel): + """ + ForwardingProfileSourceApplications + """ # noqa: E501 + applications: List[Annotated[str, Field(min_length=1, strict=True, max_length=511)]] = Field(description="List of application names to be included in this source application profile") + description: Optional[Annotated[str, Field(strict=True, max_length=1023)]] = Field(default=None, description="fowarding profile source application description") + id: Optional[StrictStr] = Field(default=None, description="The id of the source application") + name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="The unique name identifying the source application. Must be alphanumeric with allowed characters [0-9a-zA-Z._-]") + __properties: ClassVar[List[str]] = ["applications", "description", "id", "name"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-zA-Z._-]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z._-]+$/") + 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 ForwardingProfileSourceApplications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _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 ForwardingProfileSourceApplications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applications": obj.get("applications"), + "description": obj.get("description"), + "id": obj.get("id"), + "name": obj.get("name") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_user_locations.py b/scm/mobile_agent/models/forwarding_profile_user_locations.py new file mode 100644 index 00000000..fcaf74f1 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_user_locations.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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_extensions import Annotated +from scm.mobile_agent.models.forwarding_profile_user_locations_internal_host_detection import ForwardingProfileUserLocationsInternalHostDetection +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileUserLocations(BaseModel): + """ + ForwardingProfileUserLocations + """ # noqa: E501 + description: Optional[Annotated[str, Field(strict=True, max_length=1023)]] = Field(default=None, description="Description of the user location") + id: Optional[StrictStr] = Field(default=None, description="The UUID of the user location") + internal_host_detection: Optional[ForwardingProfileUserLocationsInternalHostDetection] = None + ip_addresses: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="List of IP addresses that define the user location") + name: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="alphanumeric string [ 0-9a-zA-Z._-]") + __properties: ClassVar[List[str]] = ["description", "id", "internal_host_detection", "ip_addresses", "name"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[0-9a-zA-Z._-]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z._-]+$/") + 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 ForwardingProfileUserLocations from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of internal_host_detection + if self.internal_host_detection: + _dict['internal_host_detection'] = self.internal_host_detection.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfileUserLocations from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description"), + "id": obj.get("id"), + "internal_host_detection": ForwardingProfileUserLocationsInternalHostDetection.from_dict(obj["internal_host_detection"]) if obj.get("internal_host_detection") is not None else None, + "ip_addresses": obj.get("ip_addresses"), + "name": obj.get("name") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_user_locations_internal_host_detection.py b/scm/mobile_agent/models/forwarding_profile_user_locations_internal_host_detection.py new file mode 100644 index 00000000..8d087234 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_user_locations_internal_host_detection.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, 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 ForwardingProfileUserLocationsInternalHostDetection(BaseModel): + """ + Configuration for detecting internal hosts using IP address and FQDN + """ # noqa: E501 + fqdn: Annotated[str, Field(strict=True, max_length=255)] = Field(description="user location fqdn") + ip_address: Annotated[str, Field(strict=True)] = Field(description="user location ip address") + __properties: ClassVar[List[str]] = ["fqdn", "ip_address"] + + @field_validator('fqdn') + def fqdn_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^([\*a-zA-Z0-9._-])+$", value): + raise ValueError(r"must validate the regular expression /^([\*a-zA-Z0-9._-])+$/") + return value + + @field_validator('ip_address') + def ip_address_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.((\*|(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2]?[0-9])))$", value): + raise ValueError(r"must validate the regular expression /^(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(\*|25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.((\*|(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2]?[0-9])))$/") + 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 ForwardingProfileUserLocationsInternalHostDetection from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingProfileUserLocationsInternalHostDetection from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fqdn": obj.get("fqdn"), + "ip_address": obj.get("ip_address") + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_ztna_agent.py b/scm/mobile_agent/models/forwarding_profile_ztna_agent.py new file mode 100644 index 00000000..6046fcc6 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_ztna_agent.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, Optional +from scm.mobile_agent.models.forwarding_profile_ztna_agent_ztna_agent import ForwardingProfileZtnaAgentZtnaAgent +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileZtnaAgent(BaseModel): + """ + ZTNA agent-based forwarding profile configuration + """ # noqa: E501 + ztna_agent: Optional[ForwardingProfileZtnaAgentZtnaAgent] = None + __properties: ClassVar[List[str]] = ["ztna_agent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ForwardingProfileZtnaAgent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ztna_agent + if self.ztna_agent: + _dict['ztna_agent'] = self.ztna_agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfileZtnaAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ztna_agent": ForwardingProfileZtnaAgentZtnaAgent.from_dict(obj["ztna_agent"]) if obj.get("ztna_agent") is not None else None + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profile_ztna_agent_ztna_agent.py b/scm/mobile_agent/models/forwarding_profile_ztna_agent_ztna_agent.py new file mode 100644 index 00000000..1546a90b --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profile_ztna_agent_ztna_agent.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.block_rule_ztna import BlockRuleZtna +from scm.mobile_agent.models.forwarding_rule_ztna import ForwardingRuleZtna +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfileZtnaAgentZtnaAgent(BaseModel): + """ + ZTNA agent-based forwarding configuration + """ # noqa: E501 + block_rule: Optional[BlockRuleZtna] = None + forwarding_rules: Optional[List[ForwardingRuleZtna]] = Field(default=None, description="List of ZTNA agent-based forwarding rules") + pac_upload: Optional[StrictBool] = Field(default=False, description="User uploaded PAC file for a ZTNA agent-based forwarding configuration") + __properties: ClassVar[List[str]] = ["block_rule", "forwarding_rules", "pac_upload"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ForwardingProfileZtnaAgentZtnaAgent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 block_rule + if self.block_rule: + _dict['block_rule'] = self.block_rule.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in forwarding_rules (list) + _items = [] + if self.forwarding_rules: + for _item_forwarding_rules in self.forwarding_rules: + if _item_forwarding_rules: + _items.append(_item_forwarding_rules.to_dict()) + _dict['forwarding_rules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfileZtnaAgentZtnaAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "block_rule": BlockRuleZtna.from_dict(obj["block_rule"]) if obj.get("block_rule") is not None else None, + "forwarding_rules": [ForwardingRuleZtna.from_dict(_item) for _item in obj["forwarding_rules"]] if obj.get("forwarding_rules") is not None else None, + "pac_upload": obj.get("pac_upload") if obj.get("pac_upload") is not None else False + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profiles.py b/scm/mobile_agent/models/forwarding_profiles.py new file mode 100644 index 00000000..29e39db0 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profiles.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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_extensions import Annotated +from scm.mobile_agent.models.forwarding_profiles_type import ForwardingProfilesType +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfiles(BaseModel): + """ + ForwardingProfiles + """ # noqa: E501 + definition_method: Optional[StrictStr] = Field(default='rules', description="Enable forwarding rule for forwarding profile") + description: Optional[Annotated[str, Field(strict=True, max_length=1023)]] = Field(default=None, description="Forwarding profile description") + id: Optional[StrictStr] = Field(default=None, description="The UUID of the forwarding profile") + name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="forwarding profile name as an alphanumeric string [ 0-9a-zA-Z._ -]") + type: Optional[ForwardingProfilesType] = None + __properties: ClassVar[List[str]] = ["definition_method", "description", "id", "name", "type"] + + @field_validator('definition_method') + def definition_method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['rules', 'pac-file']): + raise ValueError("must be one of enum values ('rules', 'pac-file')") + return value + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-zA-Z._ -]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z._ -]+$/") + 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 ForwardingProfiles from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of type + if self.type: + _dict['type'] = self.type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfiles from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "definition_method": obj.get("definition_method") if obj.get("definition_method") is not None else 'rules', + "description": obj.get("description"), + "id": obj.get("id"), + "name": obj.get("name"), + "type": ForwardingProfilesType.from_dict(obj["type"]) if obj.get("type") is not None else None + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_profiles_type.py b/scm/mobile_agent/models/forwarding_profiles_type.py new file mode 100644 index 00000000..60f98195 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_profiles_type.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, Optional +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy_global_protect_proxy import ForwardingProfileGlobalProtectProxyGlobalProtectProxy +from scm.mobile_agent.models.forwarding_profile_pac_file_pac_file import ForwardingProfilePacFilePacFile +from scm.mobile_agent.models.forwarding_profile_ztna_agent_ztna_agent import ForwardingProfileZtnaAgentZtnaAgent +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingProfilesType(BaseModel): + """ + Forwarding profile type configuration (PAC file, GlobalProtect proxy, or ZTNA agent) + """ # noqa: E501 + global_protect_proxy: Optional[ForwardingProfileGlobalProtectProxyGlobalProtectProxy] = None + pac_file: Optional[ForwardingProfilePacFilePacFile] = None + ztna_agent: Optional[ForwardingProfileZtnaAgentZtnaAgent] = None + __properties: ClassVar[List[str]] = ["global_protect_proxy", "pac_file", "ztna_agent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ForwardingProfilesType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 global_protect_proxy + if self.global_protect_proxy: + _dict['global_protect_proxy'] = self.global_protect_proxy.to_dict() + # override the default output from pydantic by calling `to_dict()` of pac_file + if self.pac_file: + _dict['pac_file'] = self.pac_file.to_dict() + # override the default output from pydantic by calling `to_dict()` of ztna_agent + if self.ztna_agent: + _dict['ztna_agent'] = self.ztna_agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ForwardingProfilesType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "global_protect_proxy": ForwardingProfileGlobalProtectProxyGlobalProtectProxy.from_dict(obj["global_protect_proxy"]) if obj.get("global_protect_proxy") is not None else None, + "pac_file": ForwardingProfilePacFilePacFile.from_dict(obj["pac_file"]) if obj.get("pac_file") is not None else None, + "ztna_agent": ForwardingProfileZtnaAgentZtnaAgent.from_dict(obj["ztna_agent"]) if obj.get("ztna_agent") is not None else None + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_rule_basic.py b/scm/mobile_agent/models/forwarding_rule_basic.py new file mode 100644 index 00000000..4790baba --- /dev/null +++ b/scm/mobile_agent/models/forwarding_rule_basic.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, 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 ForwardingRuleBasic(BaseModel): + """ + Basic forwarding rule configuration for PAC file and GlobalProtect proxy profiles + """ # noqa: E501 + connectivity: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default='direct', description="Connectivity method for this forwarding rule (e.g. direct)") + destinations: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default='Any', description="Destination scope this forwarding rule applies to") + enabled: Optional[StrictBool] = Field(default=True, description="Enable a basic forwarding rule") + name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="Basic forwarding rule name as an alphanumeric string [ 0-9a-zA-Z._ -]") + user_locations: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default='Any', description="User location scope this rule applies to") + __properties: ClassVar[List[str]] = ["connectivity", "destinations", "enabled", "name", "user_locations"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-zA-Z._ -]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z._ -]+$/") + 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 ForwardingRuleBasic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingRuleBasic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "connectivity": obj.get("connectivity") if obj.get("connectivity") is not None else 'direct', + "destinations": obj.get("destinations") if obj.get("destinations") is not None else 'Any', + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "name": obj.get("name"), + "user_locations": obj.get("user_locations") if obj.get("user_locations") is not None else 'Any' + }) + return _obj + + diff --git a/scm/mobile_agent/models/forwarding_rule_ztna.py b/scm/mobile_agent/models/forwarding_rule_ztna.py new file mode 100644 index 00000000..6086d461 --- /dev/null +++ b/scm/mobile_agent/models/forwarding_rule_ztna.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ForwardingRuleZtna(BaseModel): + """ + ZTNA forwarding rule configuration + """ # noqa: E501 + connectivity: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default='direct', description="Connectivity method for this ZTNA forwarding rule (e.g. direct)") + destinations: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default='Any', description="Destination scope this ZTNA forwarding rule applies to") + enabled: Optional[StrictBool] = Field(default=True, description="Enable a forwarding rule ztna") + name: Annotated[str, Field(strict=True, max_length=64)] = Field(description="Forwarding rule ZTNA name as an alphanumeric string [ 0-9a-zA-Z._ -]") + source_applications: Optional[StrictStr] = Field(default='Any', description="Source applications this ZTNA rule applies to") + traffic_type: Optional[StrictStr] = Field(default='dns', description="Type of traffic this ZTNA rule applies to (dns, network, or both)") + user_locations: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default='Any', description="User location scope this ZTNA rule applies to") + __properties: ClassVar[List[str]] = ["connectivity", "destinations", "enabled", "name", "source_applications", "traffic_type", "user_locations"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9a-zA-Z._ -]+$", value): + raise ValueError(r"must validate the regular expression /^[0-9a-zA-Z._ -]+$/") + return value + + @field_validator('traffic_type') + def traffic_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['dns', 'dns-and-network-traffic', 'network-traffic']): + raise ValueError("must be one of enum values ('dns', 'dns-and-network-traffic', 'network-traffic')") + 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 ForwardingRuleZtna from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ForwardingRuleZtna from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "connectivity": obj.get("connectivity") if obj.get("connectivity") is not None else 'direct', + "destinations": obj.get("destinations") if obj.get("destinations") is not None else 'Any', + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "name": obj.get("name"), + "source_applications": obj.get("source_applications") if obj.get("source_applications") is not None else 'Any', + "traffic_type": obj.get("traffic_type") if obj.get("traffic_type") is not None else 'dns', + "user_locations": obj.get("user_locations") if obj.get("user_locations") is not None else 'Any' + }) + return _obj + + diff --git a/scm/mobile_agent/models/generic_error.py b/scm/mobile_agent/models/generic_error.py new file mode 100644 index 00000000..b2aed2d2 --- /dev/null +++ b/scm/mobile_agent/models/generic_error.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.error_detail_cause_info import ErrorDetailCauseInfo +from typing import Optional, Set +from typing_extensions import Self + +class GenericError(BaseModel): + """ + Generic error response structure + """ # noqa: E501 + errors: Optional[List[ErrorDetailCauseInfo]] = Field(default=None, description="Array of detailed error cause information", alias="_errors") + request_id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the API request", alias="_request_id") + __properties: ClassVar[List[str]] = ["_errors", "_request_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GenericError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['_errors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GenericError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "_errors": [ErrorDetailCauseInfo.from_dict(_item) for _item in obj["_errors"]] if obj.get("_errors") is not None else None, + "_request_id": obj.get("_request_id") + }) + return _obj + + diff --git a/scm/mobile_agent/models/global_protect_destinations_list_response.py b/scm/mobile_agent/models/global_protect_destinations_list_response.py new file mode 100644 index 00000000..7314b83c --- /dev/null +++ b/scm/mobile_agent/models/global_protect_destinations_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from typing import Optional, Set +from typing_extensions import Self + +class GlobalProtectDestinationsListResponse(BaseModel): + """ + GlobalProtectDestinationsListResponse + """ # noqa: E501 + data: List[ForwardingProfileDestinations] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GlobalProtectDestinationsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GlobalProtectDestinationsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = ForwardingProfileDestinations.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [ForwardingProfileDestinations.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/mobile_agent/models/global_protect_forwarding_profiles_list_response.py b/scm/mobile_agent/models/global_protect_forwarding_profiles_list_response.py new file mode 100644 index 00000000..0f1c5d2a --- /dev/null +++ b/scm/mobile_agent/models/global_protect_forwarding_profiles_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from typing import Optional, Set +from typing_extensions import Self + +class GlobalProtectForwardingProfilesListResponse(BaseModel): + """ + GlobalProtectForwardingProfilesListResponse + """ # noqa: E501 + data: List[ForwardingProfiles] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GlobalProtectForwardingProfilesListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GlobalProtectForwardingProfilesListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = ForwardingProfiles.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [ForwardingProfiles.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/mobile_agent/models/global_protect_regional_and_custom_proxies_list_response.py b/scm/mobile_agent/models/global_protect_regional_and_custom_proxies_list_response.py new file mode 100644 index 00000000..cd3cea2e --- /dev/null +++ b/scm/mobile_agent/models/global_protect_regional_and_custom_proxies_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from typing import Optional, Set +from typing_extensions import Self + +class GlobalProtectRegionalAndCustomProxiesListResponse(BaseModel): + """ + GlobalProtectRegionalAndCustomProxiesListResponse + """ # noqa: E501 + data: List[ForwardingProfileRegionalAndCustomProxies] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GlobalProtectRegionalAndCustomProxiesListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GlobalProtectRegionalAndCustomProxiesListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = ForwardingProfileRegionalAndCustomProxies.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [ForwardingProfileRegionalAndCustomProxies.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/mobile_agent/models/global_protect_source_applications_list_response.py b/scm/mobile_agent/models/global_protect_source_applications_list_response.py new file mode 100644 index 00000000..d151eaec --- /dev/null +++ b/scm/mobile_agent/models/global_protect_source_applications_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from typing import Optional, Set +from typing_extensions import Self + +class GlobalProtectSourceApplicationsListResponse(BaseModel): + """ + GlobalProtectSourceApplicationsListResponse + """ # noqa: E501 + data: List[ForwardingProfileSourceApplications] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GlobalProtectSourceApplicationsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GlobalProtectSourceApplicationsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = ForwardingProfileSourceApplications.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [ForwardingProfileSourceApplications.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/mobile_agent/models/global_protect_user_locations_list_response.py b/scm/mobile_agent/models/global_protect_user_locations_list_response.py new file mode 100644 index 00000000..a9556b35 --- /dev/null +++ b/scm/mobile_agent/models/global_protect_user_locations_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from typing import Optional, Set +from typing_extensions import Self + +class GlobalProtectUserLocationsListResponse(BaseModel): + """ + GlobalProtectUserLocationsListResponse + """ # noqa: E501 + data: List[ForwardingProfileUserLocations] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GlobalProtectUserLocationsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GlobalProtectUserLocationsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = ForwardingProfileUserLocations.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [ForwardingProfileUserLocations.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/mobile_agent/rest.py b/scm/mobile_agent/rest.py new file mode 100644 index 00000000..9753119f --- /dev/null +++ b/scm/mobile_agent/rest.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + GlobalProtect + + These APIs are used for defining and managing Prisma Access GlobalProtect services within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from scm.mobile_agent.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) diff --git a/scm/mobile_agent/tests/__init__.py b/scm/mobile_agent/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/scm/mobile_agent/tests/api_destinations_test.py b/scm/mobile_agent/tests/api_destinations_test.py new file mode 100644 index 00000000..b468ebf8 --- /dev/null +++ b/scm/mobile_agent/tests/api_destinations_test.py @@ -0,0 +1,383 @@ + +import logging +import uuid +import json +import pytest +from scm import Scm +from scm.mobile_agent.models.forwarding_profile_destinations import ForwardingProfileDestinations +from scm.mobile_agent.models.forwarding_profile_destination_fqdn_entry import ForwardingProfileDestinationFqdnEntry +from scm.mobile_agent.models.forwarding_profile_destination_ip_entry import ForwardingProfileDestinationIpEntry +from scm.test_helpers import perform + +# Configure logging to see details during test execution (use pytest -s) +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# ----------------------------------------------------------------------------- +# CONFIGURATION +# ----------------------------------------------------------------------------- +# Folder to use for testing. Ensure this exists in your SCM environment. +TARGET_FOLDER = "Mobile Users" +# ----------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def client(): + """ + Fixture to initialize the SCM client once for the module. + Assumes SCM_CLIENT_ID, SCM_CLIENT_SECRET, SCM_TSG_ID are set in env. + """ + try: + return Scm(log_level="DEBUG") + except Exception as e: + pytest.skip(f"Skipping tests due to client initialization failure: {e}") + +@pytest.fixture(scope="module") +def destinations_api(client): + """ + Fixture to return the Destinations API instance. + """ + return client.mobile_agent.DestinationsApi(client.mobile_agent.api_client) + +@pytest.fixture +def clean_destination(destinations_api): + """ + Fixture to create a temporary destination for testing and automatically delete it after. + This mimics the 'Setup' and 'Cleanup' phases of your Go tests. + """ + # 1. SETUP: Create ForwardingProfileDestinations + object_name = f"test-dest-{uuid.uuid4().hex[:6]}" + + # Create FQDN entry + fqdn_entry = ForwardingProfileDestinationFqdnEntry( + name="www.google.com", + port=80 + ) + + # NOTE: 'id' is required by the Pydantic model but excluded from the API request. + # We pass an empty string to satisfy validation. + payload = ForwardingProfileDestinations( + id="", + name=object_name, + fqdn=[fqdn_entry], + description="Created via Automated Pytest Fixture" + ) + + # Use perform helper with _with_http_info + logger.info(f"\n[SETUP] Creating ForwardingProfileDestinations: {object_name}") + created_obj = perform( + destinations_api.create_global_protect_destination_with_http_info, + response_type=ForwardingProfileDestinations, + folder=TARGET_FOLDER, + forwarding_profile_destinations=payload + ) + + assert created_obj.id is not None + + # Pass control to the test function + yield created_obj + + # 2. TEARDOWN: Delete ForwardingProfileDestinations + logger.info(f"\n[TEARDOWN] Deleting ForwardingProfileDestinations ID: {created_obj.id}") + try: + perform( + destinations_api.delete_global_protect_destination, + id=created_obj.id + ) + except Exception as e: + logger.info(f"Teardown failed (might have been deleted in test): {e}") + + +def test_create_destination(destinations_api): + """ + Test manual creation and deletion of a destination with both FQDN and IP address entries. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_Create + """ + object_name = f"test-dest-create-{uuid.uuid4().hex[:6]}" + + # Create FQDN entry + fqdn_entry = ForwardingProfileDestinationFqdnEntry( + name="www.google.com", + port=80 + ) + + # Create IP address entry + ip_entry = ForwardingProfileDestinationIpEntry( + name="10.2.3.4", + port=345 + ) + + payload = ForwardingProfileDestinations( + id="", + name=object_name, + description="test", + fqdn=[fqdn_entry], + ip_addresses=[ip_entry] + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfileDestinations: {object_name}") + + # Create using perform helper + created_obj = perform( + destinations_api.create_global_protect_destination_with_http_info, + response_type=ForwardingProfileDestinations, + folder=TARGET_FOLDER, + forwarding_profile_destinations=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert created_obj.description == "test" + + # Verify FQDN entry + assert len(created_obj.fqdn) == 1 + assert created_obj.fqdn[0].name == "www.google.com" + assert created_obj.fqdn[0].port == 80 + + # Verify IP address entry + assert len(created_obj.ip_addresses) == 1 + assert created_obj.ip_addresses[0].name == "10.2.3.4" + assert created_obj.ip_addresses[0].port == 345 + + logger.info(f"Successfully created and validated ForwardingProfileDestinations: {object_name} with ID: {created_obj.id}") + + # Cleanup + perform( + destinations_api.delete_global_protect_destination, + id=created_obj.id + ) + + +def test_get_destination_by_id(destinations_api, clean_destination): + """ + Test retrieving a destination by ID. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_GetByID + Uses 'clean_destination' fixture to handle creation/deletion automatically. + """ + # Retrieve using perform helper + fetched_obj = perform( + destinations_api.get_global_protect_destination_by_id, + response_type=ForwardingProfileDestinations, + id=clean_destination.id + ) + + # Verify + assert fetched_obj.id == clean_destination.id + assert fetched_obj.name == clean_destination.name + logger.info(f"Successfully retrieved ForwardingProfileDestinations by ID: {fetched_obj.id}") + + +def test_update_destination(destinations_api, clean_destination): + """ + Test updating an existing destination. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_Update + """ + # Prepare Update + update_payload = clean_destination + update_payload.description = "Updated description" + + # Perform Update using helper + updated_obj = perform( + destinations_api.update_global_protect_destination_by_id, + response_type=ForwardingProfileDestinations, + id=clean_destination.id, + forwarding_profile_destinations=update_payload + ) + + # Verify + assert updated_obj.description == "Updated description" + assert updated_obj.name == clean_destination.name + assert updated_obj.id == clean_destination.id + logger.info(f"Successfully updated ForwardingProfileDestinations: {updated_obj.id}") + + +def test_list_destinations(destinations_api, clean_destination): + """ + Test listing destinations with folder filter. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_List + """ + # List with filter using helper + response = perform( + destinations_api.list_global_protect_destinations, + folder=TARGET_FOLDER, + limit=10000 + ) + + assert response is not None + assert len(response.data) > 0 + + # Verify our destination is in the list + found_dest = False + for dest in response.data: + if dest.name == clean_destination.name: + found_dest = True + break + + assert found_dest, f"Created ForwardingProfileDestinations '{clean_destination.name}' should be found in the list" + logger.info(f"List returned {len(response.data)} items and found our destination") + + +def test_delete_destination_by_id(destinations_api): + """ + Test deletion specifically. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_DeleteByID + We manually create and delete here to verify the delete logic explicitly. + """ + from scm.exceptions import ObjectNotPresentError + + # Setup + object_name = f"test-dest-delete-{uuid.uuid4().hex[:6]}" + + fqdn_entry = ForwardingProfileDestinationFqdnEntry( + name="www.google.com", + port=80 + ) + + payload = ForwardingProfileDestinations( + id="", + name=object_name, + fqdn=[fqdn_entry], + description="Test destination for delete API testing" + ) + + created_obj = perform( + destinations_api.create_global_protect_destination_with_http_info, + response_type=ForwardingProfileDestinations, + folder=TARGET_FOLDER, + forwarding_profile_destinations=payload + ) + + # Perform Delete using helper + perform( + destinations_api.delete_global_protect_destination, + id=created_obj.id + ) + + logger.info(f"Successfully deleted ForwardingProfileDestinations: {created_obj.id}") + + +def test_get_destination_by_id_not_found(destinations_api): + """ + Test that fetching a non-existent destination returns 404. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_GetByID_NotFound + """ + from scm.exceptions import ObjectNotPresentError + + non_existent_id = "00000000-0000-0000-0000-000000000000" + + with pytest.raises(ObjectNotPresentError): + destinations_api.get_global_protect_destination_by_id(id=non_existent_id) + + logger.info(f"Correctly raised ObjectNotPresentError for non-existent destination") + + +def test_update_destination_by_id_not_found(destinations_api): + """ + Test that updating a non-existent destination returns 404. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_UpdateByID_NotFound + """ + from scm.exceptions import ObjectNotPresentError + + non_existent_id = "00000000-0000-0000-0000-000000000000" + + fqdn_entry = ForwardingProfileDestinationFqdnEntry( + name="www.google.com", + port=80 + ) + + payload = ForwardingProfileDestinations( + id="", + name="non-existent-dest", + fqdn=[fqdn_entry] + ) + + with pytest.raises(ObjectNotPresentError): + destinations_api.update_global_protect_destination_by_id( + id=non_existent_id, + forwarding_profile_destinations=payload + ) + + logger.info(f"Correctly raised ObjectNotPresentError when updating non-existent destination") + + +def test_delete_destination_by_id_not_found(destinations_api): + """ + Test that deleting a non-existent destination returns 404. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_DeleteByID_NotFound + """ + from scm.exceptions import ObjectNotPresentError + + non_existent_id = "00000000-0000-0000-0000-000000000000" + + with pytest.raises(ObjectNotPresentError): + destinations_api.delete_global_protect_destination(id=non_existent_id) + + logger.info(f"Correctly raised ObjectNotPresentError when deleting non-existent destination") + + +def test_delete_destination_verify_gone(destinations_api): + """ + Test that a deleted destination is no longer retrievable. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_DeleteByID_VerifyGone + """ + from scm.exceptions import ObjectNotPresentError + + # Setup + object_name = f"test-dest-gone-{uuid.uuid4().hex[:6]}" + + fqdn_entry = ForwardingProfileDestinationFqdnEntry( + name="www.google.com", + port=80 + ) + + payload = ForwardingProfileDestinations( + id="", + name=object_name, + fqdn=[fqdn_entry], + description="Test destination for delete-verify test" + ) + + created_obj = perform( + destinations_api.create_global_protect_destination_with_http_info, + response_type=ForwardingProfileDestinations, + folder=TARGET_FOLDER, + forwarding_profile_destinations=payload + ) + + # Delete + perform( + destinations_api.delete_global_protect_destination, + id=created_obj.id + ) + + # Verify it's gone (should raise ObjectNotPresentError) + with pytest.raises(ObjectNotPresentError): + destinations_api.get_global_protect_destination_by_id(id=created_obj.id) + + logger.info(f"Verified destination is gone after deletion") + + +def test_fetch_destinations(destinations_api, clean_destination): + """ + Test fetching a single destination by name using the fetch convenience method. + Equivalent to Go: Test_mobile_agent_DestinationsAPIService_FetchDestinations + """ + # Test 1: Fetch existing object by name + fetched_obj = destinations_api.fetch_destinations( + name=clean_destination.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found destination '{clean_destination.name}'" + assert fetched_obj.id == clean_destination.id + assert fetched_obj.name == clean_destination.name + logger.info(f"fetch_destinations found object: {fetched_obj.name}") + + # Test 2: Fetch non-existent object (should return None) + not_found = destinations_api.fetch_destinations( + name="non-existent-destination-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent destination" + logger.info(f"fetch_destinations correctly returned None for non-existent destination") diff --git a/scm/mobile_agent/tests/api_forwarding_profiles_test.py b/scm/mobile_agent/tests/api_forwarding_profiles_test.py new file mode 100644 index 00000000..e9e398db --- /dev/null +++ b/scm/mobile_agent/tests/api_forwarding_profiles_test.py @@ -0,0 +1,329 @@ + +import logging +import uuid +import json +import pytest +from scm import Scm +from scm.mobile_agent.models.forwarding_profiles import ForwardingProfiles +from scm.mobile_agent.models.forwarding_profiles_type import ForwardingProfilesType +from scm.mobile_agent.models.forwarding_profile_global_protect_proxy_global_protect_proxy import ForwardingProfileGlobalProtectProxyGlobalProtectProxy +from scm.mobile_agent.models.forwarding_profile_ztna_agent_ztna_agent import ForwardingProfileZtnaAgentZtnaAgent +from scm.mobile_agent.models.forwarding_rule_ztna import ForwardingRuleZtna +from scm.mobile_agent.models.block_rule_ztna import BlockRuleZtna +from scm.test_helpers import perform + +# Configure logging to see details during test execution (use pytest -s) +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# ----------------------------------------------------------------------------- +# CONFIGURATION +# ----------------------------------------------------------------------------- +# Folder to use for testing. Ensure this exists in your SCM environment. +TARGET_FOLDER = "Mobile Users" +# ----------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def client(): + """ + Fixture to initialize the SCM client once for the module. + Assumes SCM_CLIENT_ID, SCM_CLIENT_SECRET, SCM_TSG_ID are set in env. + """ + try: + return Scm(log_level="DEBUG") + except Exception as e: + pytest.skip(f"Skipping tests due to client initialization failure: {e}") + +@pytest.fixture(scope="module") +def forwarding_profiles_api(client): + """ + Fixture to return the ForwardingProfiles API instance. + """ + return client.mobile_agent.ForwardingProfilesApi(client.mobile_agent.api_client) + +@pytest.fixture +def clean_forwarding_profile(forwarding_profiles_api): + """ + Fixture to create a temporary forwarding profile for testing and automatically delete it after. + This mimics the 'Setup' and 'Cleanup' phases of your Go tests. + """ + # 1. SETUP: Create ForwardingProfiles + object_name = f"test-fwdprofile-{uuid.uuid4().hex[:6]}" + + # Create a minimal valid forwarding profile + # The API requires the 'type' node even though the OpenAPI schema marks only 'name' as required + # GlobalProtectProxy has all-optional sub-fields so an empty struct satisfies the server + global_protect_proxy = ForwardingProfileGlobalProtectProxyGlobalProtectProxy() + + profile_type = ForwardingProfilesType( + global_protect_proxy=global_protect_proxy + ) + + # NOTE: 'id' is required by the Pydantic model but excluded from the API request. + # We pass an empty string to satisfy validation. + payload = ForwardingProfiles( + id="", + name=object_name, + type=profile_type, + description="Created via Automated Pytest Fixture" + ) + + # Use perform helper with _with_http_info + logger.info(f"\n[SETUP] Creating ForwardingProfile: {object_name}") + created_obj = perform( + forwarding_profiles_api.create_global_protect_forwarding_profile_with_http_info, + response_type=ForwardingProfiles, + folder=TARGET_FOLDER, + forwarding_profiles=payload + ) + + assert created_obj.id is not None + + # Pass control to the test function + yield created_obj + + # 2. TEARDOWN: Delete ForwardingProfile + logger.info(f"\n[TEARDOWN] Deleting ForwardingProfile ID: {created_obj.id}") + try: + perform( + forwarding_profiles_api.delete_global_protect_forwarding_profile, + id=created_obj.id + ) + except Exception as e: + logger.info(f"Teardown failed (might have been deleted in test): {e}") + + +def test_create_forwarding_profile(forwarding_profiles_api): + """ + Test manual creation and deletion of a forwarding profile using ztna_agent type + with forwarding rule and block rule fully populated. + Equivalent to Go: Test_mobile_agent_ForwardingProfilesAPIService_Create + """ + object_name = f"test-fwdprofile-create-{uuid.uuid4().hex[:6]}" + + # Create forwarding rule + forwarding_rule = ForwardingRuleZtna( + name="rule-1", + traffic_type="dns", + enabled=True, + user_locations="Any", + source_applications="Any", + destinations="Any", + connectivity="direct" + ) + + # Create block rule + block_rule = BlockRuleZtna( + block_all_other_unmatched_outbound_connections=False, + block_outbound_lan_access_when_connected_to_tunnel=False, + block_inbound_access_when_connected_to_tunnel=False, + block_non_tcp_non_udp_traffic_when_connected_to_tunnel=False, + allow_icmp_for_troubleshooting=False, + enforcer_fqdn_dns_resolution_via_dns_servers=True, + resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel=True + ) + + # Create ztna_agent type + ztna_agent = ForwardingProfileZtnaAgentZtnaAgent( + pac_upload=False, + forwarding_rules=[forwarding_rule], + block_rule=block_rule + ) + + profile_type = ForwardingProfilesType( + ztna_agent=ztna_agent + ) + + payload = ForwardingProfiles( + id="", + name=object_name, + description="Test forwarding profile for create", + definition_method="rules", + type=profile_type, + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfile: {object_name}") + + # Create using perform helper + created_obj = perform( + forwarding_profiles_api.create_global_protect_forwarding_profile_with_http_info, + response_type=ForwardingProfiles, + folder=TARGET_FOLDER, + forwarding_profiles=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert created_obj.description == "Test forwarding profile for create" + + # Verify type and ztna_agent + assert created_obj.type is not None + assert created_obj.type.ztna_agent is not None + + returned_ztna = created_obj.type.ztna_agent + assert returned_ztna.pac_upload is False + + # Verify forwarding rule + assert len(returned_ztna.forwarding_rules) == 1 + rule = returned_ztna.forwarding_rules[0] + assert rule.name == "rule-1" + assert rule.traffic_type == "dns" + assert rule.enabled is True + assert rule.user_locations == "Any" + assert rule.source_applications == "Any" + assert rule.destinations == "Any" + assert rule.connectivity == "direct" + + # Verify block rule + assert returned_ztna.block_rule is not None + br = returned_ztna.block_rule + assert br.block_all_other_unmatched_outbound_connections is False + assert br.block_outbound_lan_access_when_connected_to_tunnel is False + assert br.block_inbound_access_when_connected_to_tunnel is False + assert br.block_non_tcp_non_udp_traffic_when_connected_to_tunnel is False + assert br.allow_icmp_for_troubleshooting is False + assert br.enforcer_fqdn_dns_resolution_via_dns_servers is True + assert br.resolve_all_fqdns_using_dns_servers_assigned_by_the_tunnel is True + + logger.info(f"Successfully created and validated ForwardingProfile: {object_name} with ID: {created_obj.id}") + + # Cleanup + perform( + forwarding_profiles_api.delete_global_protect_forwarding_profile, + id=created_obj.id + ) + + +def test_get_forwarding_profile_by_id(forwarding_profiles_api, clean_forwarding_profile): + """ + Test retrieving a forwarding profile by ID. + Equivalent to Go: Test_mobile_agent_ForwardingProfilesAPIService_GetByID + Uses 'clean_forwarding_profile' fixture to handle creation/deletion automatically. + """ + # Retrieve using perform helper + fetched_obj = perform( + forwarding_profiles_api.get_global_protect_forwarding_profile_by_id, + response_type=ForwardingProfiles, + id=clean_forwarding_profile.id + ) + + # Verify + assert fetched_obj.id == clean_forwarding_profile.id + assert fetched_obj.name == clean_forwarding_profile.name + logger.info(f"Successfully retrieved ForwardingProfile by ID: {fetched_obj.id}") + + +def test_update_forwarding_profile(forwarding_profiles_api, clean_forwarding_profile): + """ + Test updating an existing forwarding profile. + Equivalent to Go: Test_mobile_agent_ForwardingProfilesAPIService_Update + """ + # Prepare Update + update_payload = clean_forwarding_profile + update_payload.description = "Updated description" + + # Perform Update using helper + updated_obj = perform( + forwarding_profiles_api.update_global_protect_forwarding_profile_by_id, + response_type=ForwardingProfiles, + id=clean_forwarding_profile.id, + forwarding_profiles=update_payload + ) + + # Verify + assert updated_obj.description == "Updated description" + assert updated_obj.name == clean_forwarding_profile.name + assert updated_obj.id == clean_forwarding_profile.id + logger.info(f"Successfully updated ForwardingProfile: {updated_obj.id}") + + +def test_list_forwarding_profiles(forwarding_profiles_api, clean_forwarding_profile): + """ + Test listing forwarding profiles with folder filter. + Equivalent to Go: Test_mobile_agent_ForwardingProfilesAPIService_List + """ + # List with filter using helper + response = perform( + forwarding_profiles_api.list_global_protect_forwarding_profiles, + folder=TARGET_FOLDER, + limit=10000 + ) + + assert response is not None + assert len(response.data) > 0 + + # Verify our profile is in the list + found_profile = False + for profile in response.data: + if profile.name == clean_forwarding_profile.name: + found_profile = True + break + + assert found_profile, f"Created ForwardingProfile '{clean_forwarding_profile.name}' should be found in the list" + logger.info(f"List returned {len(response.data)} items and found our profile") + + +def test_delete_forwarding_profile_by_id(forwarding_profiles_api): + """ + Test deletion specifically. + Equivalent to Go: Test_mobile_agent_ForwardingProfilesAPIService_DeleteByID + We manually create and delete here to verify the delete logic explicitly. + """ + from scm.exceptions import ObjectNotPresentError + + # Setup + object_name = f"test-fwdprofile-delete-{uuid.uuid4().hex[:6]}" + + global_protect_proxy = ForwardingProfileGlobalProtectProxyGlobalProtectProxy() + profile_type = ForwardingProfilesType( + global_protect_proxy=global_protect_proxy + ) + + payload = ForwardingProfiles( + id="", + name=object_name, + type=profile_type, + description="Test forwarding profile for delete API testing" + ) + + created_obj = perform( + forwarding_profiles_api.create_global_protect_forwarding_profile_with_http_info, + response_type=ForwardingProfiles, + folder=TARGET_FOLDER, + forwarding_profiles=payload + ) + + # Perform Delete using helper + perform( + forwarding_profiles_api.delete_global_protect_forwarding_profile, + id=created_obj.id + ) + + logger.info(f"Successfully deleted ForwardingProfile: {created_obj.id}") + + +def test_fetch_forwarding_profiles(forwarding_profiles_api, clean_forwarding_profile): + """ + Test fetching a single forwarding profile by name using the fetch convenience method. + Equivalent to Go: Test_mobile_agent_ForwardingProfilesAPIService_FetchForwardingProfiles + """ + # Test 1: Fetch existing object by name + fetched_obj = forwarding_profiles_api.fetch_forwarding_profiles( + name=clean_forwarding_profile.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found forwarding profile '{clean_forwarding_profile.name}'" + assert fetched_obj.id == clean_forwarding_profile.id + assert fetched_obj.name == clean_forwarding_profile.name + logger.info(f"fetch_forwarding_profiles found object: {fetched_obj.name}") + + # Test 2: Fetch non-existent object (should return None) + not_found = forwarding_profiles_api.fetch_forwarding_profiles( + name="non-existent-forwarding-profile-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent forwarding profile" + logger.info(f"fetch_forwarding_profiles correctly returned None for non-existent forwarding profile") diff --git a/scm/mobile_agent/tests/api_regional_and_custom_proxies_test.py b/scm/mobile_agent/tests/api_regional_and_custom_proxies_test.py new file mode 100644 index 00000000..9356d94e --- /dev/null +++ b/scm/mobile_agent/tests/api_regional_and_custom_proxies_test.py @@ -0,0 +1,527 @@ + +import logging +import uuid +import pytest +from scm import Scm +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies import ForwardingProfileRegionalAndCustomProxies +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy1 import ForwardingProfileRegionalAndCustomProxiesProxy1 +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_proxy2 import ForwardingProfileRegionalAndCustomProxiesProxy2 +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_connectivity_preference_inner import ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner +from scm.mobile_agent.models.forwarding_profile_regional_and_custom_proxies_prisma_access_locations_inner import ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner +from scm.test_helpers import perform + +# Configure logging to see details during test execution (use pytest -s) +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# ----------------------------------------------------------------------------- +# CONFIGURATION +# ----------------------------------------------------------------------------- +# Folder to use for testing gp-and-pac proxies. Ensure this exists in your SCM environment. +TARGET_FOLDER = "Mobile Users" +# Folder to use for testing ztna-agent proxies. +ZTNA_FOLDER = "All" +# ----------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def client(): + """ + Fixture to initialize the SCM client once for the module. + Assumes SCM_CLIENT_ID, SCM_CLIENT_SECRET, SCM_TSG_ID are set in env. + """ + try: + return Scm(log_level="DEBUG") + except Exception as e: + pytest.skip(f"Skipping tests due to client initialization failure: {e}") + +@pytest.fixture(scope="module") +def regional_and_custom_proxies_api(client): + """ + Fixture to return the RegionalAndCustomProxies API instance. + """ + return client.mobile_agent.RegionalAndCustomProxiesApi(client.mobile_agent.api_client) + +@pytest.fixture +def clean_regional_and_custom_proxy(regional_and_custom_proxies_api): + """ + Fixture to create a temporary gp-and-pac regional and custom proxy for testing + and automatically delete it after. + This mimics the 'Setup' and 'Cleanup' phases of your Go tests. + """ + # 1. SETUP: Create ForwardingProfileRegionalAndCustomProxies + object_name = f"test-regcustproxy-{uuid.uuid4().hex[:6]}" + + proxy1 = ForwardingProfileRegionalAndCustomProxiesProxy1( + fqdn="mail.gmail.com", + port=80, + location="us" + ) + proxy2 = ForwardingProfileRegionalAndCustomProxiesProxy2( + fqdn="www.google.com", + port=90, + location="us" + ) + + # NOTE: 'id' is required by the Pydantic model but excluded from the API request. + # We pass an empty string to satisfy validation. + # The type "gp-and-pac" is required by the server. + payload = ForwardingProfileRegionalAndCustomProxies( + id="", + name=object_name, + type="gp-and-pac", + proxy_1=proxy1, + proxy_2=proxy2, + description="Created via Automated Pytest Fixture" + ) + + # Use perform helper with _with_http_info + logger.info(f"\n[SETUP] Creating ForwardingProfileRegionalAndCustomProxies: {object_name}") + created_obj = perform( + regional_and_custom_proxies_api.create_global_protect_regional_and_custom_proxies_with_http_info, + response_type=ForwardingProfileRegionalAndCustomProxies, + folder=TARGET_FOLDER, + forwarding_profile_regional_and_custom_proxies=payload + ) + + assert created_obj.id is not None + + # Pass control to the test function + yield created_obj + + # 2. TEARDOWN: Delete ForwardingProfileRegionalAndCustomProxies + logger.info(f"\n[TEARDOWN] Deleting ForwardingProfileRegionalAndCustomProxies ID: {created_obj.id}") + try: + perform( + regional_and_custom_proxies_api.delete_global_protect_regional_and_custom_proxies, + id=created_obj.id + ) + except Exception as e: + logger.info(f"Teardown failed (might have been deleted in test): {e}") + + +def test_create_regional_and_custom_proxy(regional_and_custom_proxies_api): + """ + Test manual creation and deletion of a gp-and-pac regional and custom proxy. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_Create + """ + object_name = f"test-regcustproxy-create-{uuid.uuid4().hex[:6]}" + + proxy1 = ForwardingProfileRegionalAndCustomProxiesProxy1( + fqdn="mail.gmail.com", + port=80, + location="us" + ) + proxy2 = ForwardingProfileRegionalAndCustomProxiesProxy2( + fqdn="www.google.com", + port=90, + location="us" + ) + + payload = ForwardingProfileRegionalAndCustomProxies( + id="", + name=object_name, + type="gp-and-pac", + proxy_1=proxy1, + proxy_2=proxy2, + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfileRegionalAndCustomProxies: {object_name}") + + created_obj = perform( + regional_and_custom_proxies_api.create_global_protect_regional_and_custom_proxies_with_http_info, + response_type=ForwardingProfileRegionalAndCustomProxies, + folder=TARGET_FOLDER, + forwarding_profile_regional_and_custom_proxies=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert created_obj.type == "gp-and-pac" + + # Validate proxy_1 + assert created_obj.proxy_1 is not None + assert created_obj.proxy_1.fqdn == "mail.gmail.com" + assert created_obj.proxy_1.location == "us" + assert created_obj.proxy_1.port == 80 + + # Validate proxy_2 + assert created_obj.proxy_2 is not None + assert created_obj.proxy_2.fqdn == "www.google.com" + assert created_obj.proxy_2.location == "us" + assert created_obj.proxy_2.port == 90 + + logger.info(f"Successfully created and validated ForwardingProfileRegionalAndCustomProxies: {object_name} with ID: {created_obj.id}") + + # Cleanup + perform( + regional_and_custom_proxies_api.delete_global_protect_regional_and_custom_proxies, + id=created_obj.id + ) + + +def test_get_regional_and_custom_proxy_by_id(regional_and_custom_proxies_api, clean_regional_and_custom_proxy): + """ + Test retrieving a regional and custom proxy by ID. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_GetByID + Uses 'clean_regional_and_custom_proxy' fixture to handle creation/deletion automatically. + """ + fetched_obj = perform( + regional_and_custom_proxies_api.get_global_protect_regional_and_custom_proxy_by_id, + response_type=ForwardingProfileRegionalAndCustomProxies, + id=clean_regional_and_custom_proxy.id + ) + + assert fetched_obj.id == clean_regional_and_custom_proxy.id + assert fetched_obj.name == clean_regional_and_custom_proxy.name + logger.info(f"Successfully retrieved ForwardingProfileRegionalAndCustomProxies by ID: {fetched_obj.id}") + + +def test_update_regional_and_custom_proxy(regional_and_custom_proxies_api, clean_regional_and_custom_proxy): + """ + Test updating an existing regional and custom proxy. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_Update + """ + update_payload = clean_regional_and_custom_proxy + update_payload.description = "Updated description" + + updated_obj = perform( + regional_and_custom_proxies_api.update_global_protect_regional_and_custom_proxy_by_id, + response_type=ForwardingProfileRegionalAndCustomProxies, + id=clean_regional_and_custom_proxy.id, + forwarding_profile_regional_and_custom_proxies=update_payload + ) + + assert updated_obj.description == "Updated description" + assert updated_obj.name == clean_regional_and_custom_proxy.name + assert updated_obj.id == clean_regional_and_custom_proxy.id + logger.info(f"Successfully updated ForwardingProfileRegionalAndCustomProxies: {updated_obj.id}") + + +def test_list_regional_and_custom_proxies(regional_and_custom_proxies_api, clean_regional_and_custom_proxy): + """ + Test listing regional and custom proxies with folder filter. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_List + """ + response = perform( + regional_and_custom_proxies_api.list_global_protect_regional_and_custom_proxies, + folder=TARGET_FOLDER, + limit=10000 + ) + + assert response is not None + assert len(response.data) > 0 + + found_proxy = False + for p in response.data: + if p.name == clean_regional_and_custom_proxy.name: + found_proxy = True + break + + assert found_proxy, f"Created ForwardingProfileRegionalAndCustomProxies '{clean_regional_and_custom_proxy.name}' should be found in the list" + logger.info(f"List returned {len(response.data)} items and found our proxy") + + +def test_delete_regional_and_custom_proxy_by_id(regional_and_custom_proxies_api): + """ + Test deletion specifically. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_DeleteByID + We manually create and delete here to verify the delete logic explicitly. + """ + object_name = f"test-regcustproxy-delete-{uuid.uuid4().hex[:6]}" + + proxy1 = ForwardingProfileRegionalAndCustomProxiesProxy1( + fqdn="mail.gmail.com", + port=80, + location="us" + ) + proxy2 = ForwardingProfileRegionalAndCustomProxiesProxy2( + fqdn="www.google.com", + port=90, + location="us" + ) + + payload = ForwardingProfileRegionalAndCustomProxies( + id="", + name=object_name, + type="gp-and-pac", + proxy_1=proxy1, + proxy_2=proxy2, + description="Test regional and custom proxy for delete API testing" + ) + + created_obj = perform( + regional_and_custom_proxies_api.create_global_protect_regional_and_custom_proxies_with_http_info, + response_type=ForwardingProfileRegionalAndCustomProxies, + folder=TARGET_FOLDER, + forwarding_profile_regional_and_custom_proxies=payload + ) + + perform( + regional_and_custom_proxies_api.delete_global_protect_regional_and_custom_proxies, + id=created_obj.id + ) + + logger.info(f"Successfully deleted ForwardingProfileRegionalAndCustomProxies: {created_obj.id}") + + +def test_fetch_regional_and_custom_proxies(regional_and_custom_proxies_api, clean_regional_and_custom_proxy): + """ + Test fetching a single regional and custom proxy by name using the fetch convenience method. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_FetchRegionalAndCustomProxies + """ + # Test 1: Fetch existing object by name + fetched_obj = regional_and_custom_proxies_api.fetch_regional_and_custom_proxies( + name=clean_regional_and_custom_proxy.name, + folder=TARGET_FOLDER + ) + + assert fetched_obj is not None, f"Should have found regional and custom proxy '{clean_regional_and_custom_proxy.name}'" + assert fetched_obj.id == clean_regional_and_custom_proxy.id + assert fetched_obj.name == clean_regional_and_custom_proxy.name + logger.info(f"fetch_regional_and_custom_proxies found object: {fetched_obj.name}") + + # Test 2: Fetch non-existent object (should return None) + not_found = regional_and_custom_proxies_api.fetch_regional_and_custom_proxies( + name="non-existent-regional-custom-proxy-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent regional and custom proxy" + logger.info("fetch_regional_and_custom_proxies correctly returned None for non-existent object") + + +def test_create_ztna_agent_proxy(regional_and_custom_proxies_api): + """ + Test creation of a ztna-agent type regional and custom proxy. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_ZtnaAgent_Create + """ + object_name = f"test-ztna-create-{uuid.uuid4().hex[:6]}" + + connectivity_pref = ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner( + name="masque", + enabled=True + ) + + prisma_location = ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner( + name="americas", + locations=["us-southwest"] + ) + + payload = ForwardingProfileRegionalAndCustomProxies( + id="", + name=object_name, + type="ztna-agent", + connectivity_preference=[connectivity_pref], + fallback_option="fail-open", + location_preference="specific-pa-location", + prisma_access_locations=[prisma_location] + ) + + logger.info(f"\n[TEST] Attempting to create ZTNA Agent Proxy: {object_name}") + + created_obj = perform( + regional_and_custom_proxies_api.create_global_protect_regional_and_custom_proxies_with_http_info, + response_type=ForwardingProfileRegionalAndCustomProxies, + folder=ZTNA_FOLDER, + forwarding_profile_regional_and_custom_proxies=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert created_obj.type == "ztna-agent" + assert created_obj.fallback_option == "fail-open" + assert created_obj.location_preference == "specific-pa-location" + + assert len(created_obj.connectivity_preference) == 1 + assert created_obj.connectivity_preference[0].name == "masque" + assert created_obj.connectivity_preference[0].enabled is True + + assert len(created_obj.prisma_access_locations) == 1 + assert created_obj.prisma_access_locations[0].name == "americas" + assert created_obj.prisma_access_locations[0].locations == ["us-southwest"] + + logger.info(f"Successfully created and validated ZTNA Agent Proxy: {object_name} with ID: {created_obj.id}") + + # Cleanup + perform( + regional_and_custom_proxies_api.delete_global_protect_regional_and_custom_proxies, + id=created_obj.id + ) + + +@pytest.fixture +def clean_ztna_proxy(regional_and_custom_proxies_api): + """ + Fixture to create a temporary ztna-agent proxy for testing and automatically delete it after. + """ + object_name = f"test-ztna-{uuid.uuid4().hex[:6]}" + + connectivity_pref = ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner( + name="masque", + enabled=True + ) + + prisma_location = ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner( + name="americas", + locations=["us-southwest"] + ) + + payload = ForwardingProfileRegionalAndCustomProxies( + id="", + name=object_name, + type="ztna-agent", + connectivity_preference=[connectivity_pref], + fallback_option="fail-open", + location_preference="specific-pa-location", + prisma_access_locations=[prisma_location], + description="Created via Automated Pytest Fixture" + ) + + logger.info(f"\n[SETUP] Creating ZTNA Agent Proxy: {object_name}") + created_obj = perform( + regional_and_custom_proxies_api.create_global_protect_regional_and_custom_proxies_with_http_info, + response_type=ForwardingProfileRegionalAndCustomProxies, + folder=ZTNA_FOLDER, + forwarding_profile_regional_and_custom_proxies=payload + ) + + assert created_obj.id is not None + + yield created_obj + + logger.info(f"\n[TEARDOWN] Deleting ZTNA Agent Proxy ID: {created_obj.id}") + try: + perform( + regional_and_custom_proxies_api.delete_global_protect_regional_and_custom_proxies, + id=created_obj.id + ) + except Exception as e: + logger.info(f"Teardown failed (might have been deleted in test): {e}") + + +def test_get_ztna_agent_proxy_by_id(regional_and_custom_proxies_api, clean_ztna_proxy): + """ + Test retrieving a ztna-agent proxy by ID. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_ZtnaAgent_GetByID + """ + fetched_obj = perform( + regional_and_custom_proxies_api.get_global_protect_regional_and_custom_proxy_by_id, + response_type=ForwardingProfileRegionalAndCustomProxies, + id=clean_ztna_proxy.id + ) + + assert fetched_obj.id == clean_ztna_proxy.id + assert fetched_obj.name == clean_ztna_proxy.name + logger.info(f"Successfully retrieved ZTNA Agent Proxy by ID: {fetched_obj.id}") + + +def test_update_ztna_agent_proxy(regional_and_custom_proxies_api, clean_ztna_proxy): + """ + Test updating an existing ztna-agent proxy. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_ZtnaAgent_Update + """ + update_payload = clean_ztna_proxy + update_payload.description = "Updated description" + + updated_obj = perform( + regional_and_custom_proxies_api.update_global_protect_regional_and_custom_proxy_by_id, + response_type=ForwardingProfileRegionalAndCustomProxies, + id=clean_ztna_proxy.id, + forwarding_profile_regional_and_custom_proxies=update_payload + ) + + assert updated_obj.description == "Updated description" + assert updated_obj.name == clean_ztna_proxy.name + assert updated_obj.id == clean_ztna_proxy.id + logger.info(f"Successfully updated ZTNA Agent Proxy: {updated_obj.id}") + + +def test_list_ztna_agent_proxies(regional_and_custom_proxies_api, clean_ztna_proxy): + """ + Test listing ztna-agent proxies with folder filter. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_ZtnaAgent_List + """ + response = perform( + regional_and_custom_proxies_api.list_global_protect_regional_and_custom_proxies, + folder=ZTNA_FOLDER, + limit=10000 + ) + + assert response is not None + assert len(response.data) > 0 + + found_proxy = False + for p in response.data: + if p.name == clean_ztna_proxy.name: + found_proxy = True + break + + assert found_proxy, f"Created ZTNA Agent Proxy '{clean_ztna_proxy.name}' should be found in the list" + logger.info(f"List returned {len(response.data)} items and found our ZTNA Agent Proxy") + + +def test_delete_ztna_agent_proxy_by_id(regional_and_custom_proxies_api): + """ + Test deletion of a ztna-agent proxy specifically. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_ZtnaAgent_DeleteByID + """ + object_name = f"test-ztna-delete-{uuid.uuid4().hex[:6]}" + + connectivity_pref = ForwardingProfileRegionalAndCustomProxiesConnectivityPreferenceInner( + name="masque", + enabled=True + ) + + prisma_location = ForwardingProfileRegionalAndCustomProxiesPrismaAccessLocationsInner( + name="americas", + locations=["us-southwest"] + ) + + payload = ForwardingProfileRegionalAndCustomProxies( + id="", + name=object_name, + type="ztna-agent", + connectivity_preference=[connectivity_pref], + fallback_option="fail-open", + location_preference="specific-pa-location", + prisma_access_locations=[prisma_location] + ) + + created_obj = perform( + regional_and_custom_proxies_api.create_global_protect_regional_and_custom_proxies_with_http_info, + response_type=ForwardingProfileRegionalAndCustomProxies, + folder=ZTNA_FOLDER, + forwarding_profile_regional_and_custom_proxies=payload + ) + + perform( + regional_and_custom_proxies_api.delete_global_protect_regional_and_custom_proxies, + id=created_obj.id + ) + + logger.info(f"Successfully deleted ZTNA Agent Proxy: {created_obj.id}") + + +def test_fetch_ztna_agent_proxies(regional_and_custom_proxies_api, clean_ztna_proxy): + """ + Test fetching a single ztna-agent proxy by name using the fetch convenience method. + Equivalent to Go: Test_mobile_agent_RegionalAndCustomProxiesAPIService_ZtnaAgent_Fetch + """ + # Test 1: Fetch existing object by name + fetched_obj = regional_and_custom_proxies_api.fetch_regional_and_custom_proxies( + name=clean_ztna_proxy.name, + folder=ZTNA_FOLDER + ) + + assert fetched_obj is not None, f"Should have found ZTNA agent proxy '{clean_ztna_proxy.name}'" + assert fetched_obj.id == clean_ztna_proxy.id + assert fetched_obj.name == clean_ztna_proxy.name + logger.info(f"fetch_regional_and_custom_proxies found object: {fetched_obj.name}") + + # Test 2: Fetch non-existent object (should return None) + not_found = regional_and_custom_proxies_api.fetch_regional_and_custom_proxies( + name="non-existent-ztna-proxy-xyz-12345", + folder=ZTNA_FOLDER + ) + assert not_found is None, "Should return None for non-existent ZTNA agent proxy" + logger.info("fetch_regional_and_custom_proxies correctly returned None for non-existent ZTNA agent proxy") diff --git a/scm/mobile_agent/tests/api_source_applications_test.py b/scm/mobile_agent/tests/api_source_applications_test.py new file mode 100644 index 00000000..8b854cb9 --- /dev/null +++ b/scm/mobile_agent/tests/api_source_applications_test.py @@ -0,0 +1,383 @@ + +import logging +import uuid +import json +import pytest +from scm import Scm +from scm.mobile_agent.models.forwarding_profile_source_applications import ForwardingProfileSourceApplications +from scm.test_helpers import perform + +# Configure logging to see details during test execution (use pytest -s) +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# ----------------------------------------------------------------------------- +# CONFIGURATION +# ----------------------------------------------------------------------------- +# Folder to use for testing. Ensure this exists in your SCM environment. +TARGET_FOLDER = "Mobile Users" +# ----------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def client(): + """ + Fixture to initialize the SCM client once for the module. + Assumes SCM_CLIENT_ID, SCM_CLIENT_SECRET, SCM_TSG_ID are set in env. + """ + try: + return Scm(log_level="DEBUG") + except Exception as e: + pytest.skip(f"Skipping tests due to client initialization failure: {e}") + +@pytest.fixture(scope="module") +def source_applications_api(client): + """ + Fixture to return the Source Applications API instance. + """ + return client.mobile_agent.SourceApplicationsApi(client.mobile_agent.api_client) + +@pytest.fixture +def clean_source_application(source_applications_api): + """ + Fixture to create a temporary source application for testing and automatically delete it after. + This mimics the 'Setup' and 'Cleanup' phases of your Go tests. + """ + # 1. SETUP: Create ForwardingProfileSourceApplications + object_name = f"test-sourceapp-{uuid.uuid4().hex[:6]}" + + # NOTE: 'id' is required by the Pydantic model but excluded from the API request. + # We pass an empty string to satisfy validation. + payload = ForwardingProfileSourceApplications( + id="", + name=object_name, + applications=["app1", "app2"], + description="Created via Automated Pytest Fixture" + ) + + # Use perform helper with _with_http_info + logger.info(f"\n[SETUP] Creating ForwardingProfileSourceApplications: {object_name}") + created_obj = perform( + source_applications_api.create_global_protect_source_application_with_http_info, + response_type=ForwardingProfileSourceApplications, + folder=TARGET_FOLDER, + forwarding_profile_source_applications=payload + ) + + assert created_obj.id is not None + + # Pass control to the test function + yield created_obj + + # 2. TEARDOWN: Delete ForwardingProfileSourceApplications + logger.info(f"\n[TEARDOWN] Note: Source Applications may need manual cleanup - ID: {created_obj.id}") + + +def test_create_source_application(source_applications_api): + """ + Test manual creation of a source application with full set of fields including description. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_Create + """ + object_name = f"test-sourceapp-create-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileSourceApplications( + id="", + name=object_name, + description="Test source application for create", + applications=["chrome", "firefox", "safari"] + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfileSourceApplications: {object_name}") + + # Create using perform helper + created_obj = perform( + source_applications_api.create_global_protect_source_application_with_http_info, + response_type=ForwardingProfileSourceApplications, + folder=TARGET_FOLDER, + forwarding_profile_source_applications=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert created_obj.description == "Test source application for create" + + # Verify applications + assert len(created_obj.applications) == 3 + assert set(created_obj.applications) == {"chrome", "firefox", "safari"} + + logger.info(f"Successfully created and validated ForwardingProfileSourceApplications: {object_name} with ID: {created_obj.id}") + logger.info(f"Note: Source Applications may need manual cleanup - ID: {created_obj.id}") + + +def test_create_source_application_minimal(source_applications_api): + """ + Test creation of a source application with only required fields (applications and name). + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_CreateMinimal + """ + object_name = f"test-sourceapp-minimal-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileSourceApplications( + id="", + name=object_name, + applications=["app1", "app2"] + ) + + logger.info(f"\n[TEST] Attempting to create minimal ForwardingProfileSourceApplications: {object_name}") + + # Create using perform helper + created_obj = perform( + source_applications_api.create_global_protect_source_application_with_http_info, + response_type=ForwardingProfileSourceApplications, + folder=TARGET_FOLDER, + forwarding_profile_source_applications=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert set(created_obj.applications) == {"app1", "app2"} + + logger.info(f"Successfully created minimal ForwardingProfileSourceApplications: {object_name} with ID: {created_obj.id}") + + +def test_get_source_application_by_id(source_applications_api, clean_source_application): + """ + Test retrieving a source application by ID. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_GetByID + Uses 'clean_source_application' fixture to handle creation automatically. + """ + # Retrieve using perform helper + fetched_obj = perform( + source_applications_api.get_global_protect_source_application_by_id, + response_type=ForwardingProfileSourceApplications, + id=clean_source_application.id + ) + + # Verify + assert fetched_obj.id == clean_source_application.id + assert fetched_obj.name == clean_source_application.name + assert set(fetched_obj.applications) == {"app1", "app2"} + logger.info(f"Successfully retrieved ForwardingProfileSourceApplications by ID: {fetched_obj.id}") + + +def test_update_source_application(source_applications_api, clean_source_application): + """ + Test updating an existing source application. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_Update + """ + # Prepare Update + update_payload = clean_source_application + update_payload.description = "Updated description for source application" + update_payload.applications = ["chrome", "firefox", "edge"] + + # Perform Update using helper + updated_obj = perform( + source_applications_api.update_global_protect_source_application_by_id, + response_type=ForwardingProfileSourceApplications, + id=clean_source_application.id, + forwarding_profile_source_applications=update_payload + ) + + # Verify + assert updated_obj.description == "Updated description for source application" + assert updated_obj.name == clean_source_application.name + assert updated_obj.id == clean_source_application.id + assert set(updated_obj.applications) == {"chrome", "firefox", "edge"} + logger.info(f"Successfully updated ForwardingProfileSourceApplications: {updated_obj.id}") + + +def test_list_source_applications(source_applications_api, clean_source_application): + """ + Test listing source applications with folder filter. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_List + """ + # List with filter using helper + response = perform( + source_applications_api.list_global_protect_source_applications, + folder=TARGET_FOLDER, + limit=10000 + ) + + assert response is not None + assert len(response.data) > 0 + + # Verify our source application is in the list + found_app = False + for app in response.data: + if app.name == clean_source_application.name: + found_app = True + assert app.id == clean_source_application.id + assert set(app.applications) == {"app1", "app2"} + break + + assert found_app, f"Created ForwardingProfileSourceApplications '{clean_source_application.name}' should be found in the list" + logger.info(f"List returned {len(response.data)} items and found our source application") + + +def test_list_source_applications_with_name_filter(source_applications_api, clean_source_application): + """ + Test listing source applications with a name filter. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_ListWithNameFilter + """ + # List with name filter using helper + response = perform( + source_applications_api.list_global_protect_source_applications, + folder=TARGET_FOLDER, + name=clean_source_application.name, + limit=10 + ) + + assert response is not None + + # Verify our source application is in the filtered results + found_app = False + for app in response.data: + if app.name == clean_source_application.name: + found_app = True + assert app.id == clean_source_application.id + break + + assert found_app, f"Created ForwardingProfileSourceApplications '{clean_source_application.name}' should be found with name filter" + logger.info(f"Successfully filtered source applications by name: {clean_source_application.name}") + + +def test_list_source_applications_pagination(source_applications_api): + """ + Test pagination parameters when listing source applications. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_ListPagination + """ + # Create multiple test objects to test pagination + created_names = [] + random_suffix = uuid.uuid4().hex[:6] + + for i in range(3): + app_name = f"test-sourceapp-page-{random_suffix}-{i}" + created_names.append(app_name) + + payload = ForwardingProfileSourceApplications( + id="", + name=app_name, + applications=["app1", "app2"] + ) + + perform( + source_applications_api.create_global_protect_source_application_with_http_info, + response_type=ForwardingProfileSourceApplications, + folder=TARGET_FOLDER, + forwarding_profile_source_applications=payload + ) + + # Test with limit + response = perform( + source_applications_api.list_global_protect_source_applications, + folder=TARGET_FOLDER, + limit=2, + offset=0 + ) + + assert response is not None + logger.info(f"Retrieved {len(response.data)} items with limit=2") + + # Test with offset + response2 = perform( + source_applications_api.list_global_protect_source_applications, + folder=TARGET_FOLDER, + limit=10, + offset=1 + ) + + assert response2 is not None + logger.info(f"Retrieved {len(response2.data)} items with offset=1") + logger.info("Pagination test completed successfully") + + +def test_delete_source_application_by_id(source_applications_api): + """ + Test deletion specifically. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_DeleteByID + We manually create and delete here to verify the delete logic explicitly. + """ + # Setup + object_name = f"test-sourceapp-delete-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileSourceApplications( + id="", + name=object_name, + applications=["app1", "app2"], + description="Test source application for delete API testing" + ) + + created_obj = perform( + source_applications_api.create_global_protect_source_application_with_http_info, + response_type=ForwardingProfileSourceApplications, + folder=TARGET_FOLDER, + forwarding_profile_source_applications=payload + ) + + # Perform Delete using helper + perform( + source_applications_api.delete_global_protect_source_application, + id=created_obj.id + ) + + logger.info(f"Successfully deleted ForwardingProfileSourceApplications: {created_obj.id}") + + +def test_create_source_application_with_empty_applications(source_applications_api): + """ + Test that creation fails when applications list is empty (validation test). + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_CreateWithEmptyApplications + """ + object_name = f"test-sourceapp-empty-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileSourceApplications( + id="", + name=object_name, + applications=[] # empty applications list + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfileSourceApplications with empty applications list") + + # This test expects the API to reject empty applications list + # The exact behavior depends on API validation + try: + created_obj = perform( + source_applications_api.create_global_protect_source_application_with_http_info, + response_type=ForwardingProfileSourceApplications, + folder=TARGET_FOLDER, + forwarding_profile_source_applications=payload + ) + # If API accepts it, log a warning + logger.warning(f"WARNING: API accepted empty applications list") + if created_obj.id: + logger.info(f"Created object with ID: {created_obj.id} (may need cleanup)") + except Exception as e: + # Expected path: API rejects empty list + logger.info(f"API correctly rejected empty applications list with error: {e}") + + +def test_fetch_source_applications(source_applications_api, clean_source_application): + """ + Test fetching a single source application by name using the fetch convenience method. + Equivalent to Go: Test_mobile_agent_SourceApplicationsAPIService_FetchSourceApplications + """ + # Test 1: Fetch existing object by name + fetched_obj = source_applications_api.fetch_source_applications( + name=clean_source_application.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found source application '{clean_source_application.name}'" + assert fetched_obj.id == clean_source_application.id + assert fetched_obj.name == clean_source_application.name + assert fetched_obj.description == "Created via Automated Pytest Fixture" + assert set(fetched_obj.applications) == {"app1", "app2"} + logger.info(f"fetch_source_applications found object: {fetched_obj.name}") + + # Test 2: Fetch non-existent object (should return None) + not_found = source_applications_api.fetch_source_applications( + name="non-existent-source-application-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent source application" + logger.info(f"fetch_source_applications correctly returned None for non-existent source application") diff --git a/scm/mobile_agent/tests/api_user_locations_test.py b/scm/mobile_agent/tests/api_user_locations_test.py new file mode 100644 index 00000000..41b1af17 --- /dev/null +++ b/scm/mobile_agent/tests/api_user_locations_test.py @@ -0,0 +1,514 @@ + +import logging +import uuid +import json +import pytest +from scm import Scm +from scm.mobile_agent.models.forwarding_profile_user_locations import ForwardingProfileUserLocations +from scm.mobile_agent.models.forwarding_profile_user_locations_internal_host_detection import ForwardingProfileUserLocationsInternalHostDetection +from scm.test_helpers import perform + +# Configure logging to see details during test execution (use pytest -s) +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + +# ----------------------------------------------------------------------------- +# CONFIGURATION +# ----------------------------------------------------------------------------- +# Folder to use for testing. Ensure this exists in your SCM environment. +TARGET_FOLDER = "Mobile Users" +# ----------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def client(): + """ + Fixture to initialize the SCM client once for the module. + Assumes SCM_CLIENT_ID, SCM_CLIENT_SECRET, SCM_TSG_ID are set in env. + """ + try: + return Scm(log_level="DEBUG") + except Exception as e: + pytest.skip(f"Skipping tests due to client initialization failure: {e}") + +@pytest.fixture(scope="module") +def user_locations_api(client): + """ + Fixture to return the User Locations API instance. + """ + return client.mobile_agent.UserLocationsApi(client.mobile_agent.api_client) + +@pytest.fixture +def clean_user_location(user_locations_api): + """ + Fixture to create a temporary user location for testing and automatically delete it after. + This mimics the 'Setup' and 'Cleanup' phases of your Go tests. + """ + # 1. SETUP: Create ForwardingProfileUserLocations + object_name = f"test-userloc-{uuid.uuid4().hex[:6]}" + + # NOTE: 'id' is required by the Pydantic model but excluded from the API request. + # We pass an empty string to satisfy validation. + payload = ForwardingProfileUserLocations( + id="", + name=object_name, + description="Created via Automated Pytest Fixture" + ) + + # Use perform helper with _with_http_info + logger.info(f"\n[SETUP] Creating ForwardingProfileUserLocations: {object_name}") + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=payload + ) + + assert created_obj.id is not None + + # Pass control to the test function + yield created_obj + + # 2. TEARDOWN: Delete ForwardingProfileUserLocations + logger.info(f"\n[TEARDOWN] Deleting ForwardingProfileUserLocations ID: {created_obj.id}") + try: + perform( + user_locations_api.delete_global_protect_user_location, + id=created_obj.id + ) + except Exception as e: + logger.info(f"Teardown failed (might have been deleted in test): {e}") + + +def test_create_user_location(user_locations_api): + """ + Test manual creation and deletion of a user location with all possible attributes. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_Create + """ + object_name = f"test-userloc-create-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileUserLocations( + id="", + name=object_name, + description="Test user location for create with all attributes", + ip_addresses=["192.168.1.0/24", "10.0.0.0/8", "172.16.0.1"] + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfileUserLocations: {object_name}") + + # Create using perform helper + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert created_obj.description == "Test user location for create with all attributes" + + # Verify IP addresses + assert created_obj.ip_addresses is not None + assert set(created_obj.ip_addresses) == {"192.168.1.0/24", "10.0.0.0/8", "172.16.0.1"} + + logger.info(f"Successfully created and validated ForwardingProfileUserLocations: {object_name} with ID: {created_obj.id}") + + # Cleanup + perform( + user_locations_api.delete_global_protect_user_location, + id=created_obj.id + ) + + +def test_create_user_location_with_internal_host_detection(user_locations_api): + """ + Test creation of a user location with internal host detection (without ip_addresses). + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_CreateWithInternalHostDetection + """ + object_name = f"test-userloc-inthost-{uuid.uuid4().hex[:6]}" + + # Create internal host detection + internal_host_detection = ForwardingProfileUserLocationsInternalHostDetection( + fqdn="internal.example.com", + ip_address="192.168.100.1" + ) + + payload = ForwardingProfileUserLocations( + id="", + name=object_name, + description="Test user location with internal host detection", + internal_host_detection=internal_host_detection + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfileUserLocations with internal host detection: {object_name}") + + # Create using perform helper + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert created_obj.description == "Test user location with internal host detection" + + # Verify internal host detection + assert created_obj.internal_host_detection is not None + assert created_obj.internal_host_detection.fqdn == "internal.example.com" + assert created_obj.internal_host_detection.ip_address == "192.168.100.1" + + logger.info(f"Successfully created and validated ForwardingProfileUserLocations with internal host detection: {object_name} with ID: {created_obj.id}") + + # Cleanup + perform( + user_locations_api.delete_global_protect_user_location, + id=created_obj.id + ) + + +def test_create_user_location_minimal(user_locations_api): + """ + Test creation of a user location with only a name (minimal required fields). + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_CreateMinimal + """ + object_name = f"test-userloc-minimal-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileUserLocations( + id="", + name=object_name + ) + + logger.info(f"\n[TEST] Attempting to create minimal ForwardingProfileUserLocations: {object_name}") + + # Create using perform helper + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + + logger.info(f"Successfully created minimal ForwardingProfileUserLocations: {object_name} with ID: {created_obj.id}") + + # Cleanup + perform( + user_locations_api.delete_global_protect_user_location, + id=created_obj.id + ) + + +def test_create_user_location_with_ip_addresses_only(user_locations_api): + """ + Test creating a user location with just name and IP addresses (no internal host detection). + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_CreateWithIPAddressesOnly + """ + object_name = f"test-userloc-iponly-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileUserLocations( + id="", + name=object_name, + description="User location with IP addresses only", + ip_addresses=["10.10.0.0/16", "192.168.5.0/24"] + ) + + logger.info(f"\n[TEST] Attempting to create ForwardingProfileUserLocations with IP addresses only: {object_name}") + + # Create using perform helper + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=payload + ) + + assert created_obj.name == object_name + assert created_obj.id is not None + assert set(created_obj.ip_addresses) == {"10.10.0.0/16", "192.168.5.0/24"} + + logger.info(f"Successfully created ForwardingProfileUserLocations with IP addresses only: {object_name}") + + # Cleanup + perform( + user_locations_api.delete_global_protect_user_location, + id=created_obj.id + ) + + +def test_list_user_locations(user_locations_api, clean_user_location): + """ + Test listing user locations with folder filter. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_List + """ + # List with filter using helper + response = perform( + user_locations_api.list_global_protect_user_locations, + folder=TARGET_FOLDER, + limit=10000 + ) + + assert response is not None + assert len(response.data) > 0 + + # Verify our user location is in the list + found_location = False + for loc in response.data: + if loc.name == clean_user_location.name: + found_location = True + assert loc.id == clean_user_location.id + break + + assert found_location, f"Created ForwardingProfileUserLocations '{clean_user_location.name}' should be found in the list" + logger.info(f"List returned {len(response.data)} items and found our user location") + + +def test_list_user_locations_with_name_filter(user_locations_api, clean_user_location): + """ + Test listing user locations with a name filter. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_ListWithNameFilter + """ + # List with name filter using helper + response = perform( + user_locations_api.list_global_protect_user_locations, + folder=TARGET_FOLDER, + name=clean_user_location.name, + limit=10 + ) + + assert response is not None + + # Verify our user location is in the filtered results + found_location = False + for loc in response.data: + if loc.name == clean_user_location.name: + found_location = True + assert loc.id == clean_user_location.id + break + + assert found_location, f"Created ForwardingProfileUserLocations '{clean_user_location.name}' should be found with name filter" + logger.info(f"Successfully filtered user locations by name: {clean_user_location.name}") + + +def test_get_user_location_by_id(user_locations_api, clean_user_location): + """ + Test retrieving a user location by ID. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_GetByID + Uses 'clean_user_location' fixture to handle creation/deletion automatically. + """ + # Retrieve using perform helper + fetched_obj = perform( + user_locations_api.get_global_protect_user_location_by_id, + response_type=ForwardingProfileUserLocations, + id=clean_user_location.id + ) + + # Verify + assert fetched_obj.id == clean_user_location.id + assert fetched_obj.name == clean_user_location.name + logger.info(f"Successfully retrieved ForwardingProfileUserLocations by ID: {fetched_obj.id}") + + +def test_update_user_location(user_locations_api, clean_user_location): + """ + Test updating an existing user location. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_Update + """ + # Prepare Update + update_payload = clean_user_location + update_payload.description = "Updated description for user location" + update_payload.ip_addresses = ["172.20.0.0/16", "10.5.5.0/24"] + + # Perform Update using helper + updated_obj = perform( + user_locations_api.update_global_protect_user_location_by_id, + response_type=ForwardingProfileUserLocations, + id=clean_user_location.id, + forwarding_profile_user_locations=update_payload + ) + + # Verify + assert updated_obj.description == "Updated description for user location" + assert updated_obj.name == clean_user_location.name + assert updated_obj.id == clean_user_location.id + assert set(updated_obj.ip_addresses) == {"172.20.0.0/16", "10.5.5.0/24"} + logger.info(f"Successfully updated ForwardingProfileUserLocations: {updated_obj.id}") + + +def test_update_user_location_with_internal_host_detection(user_locations_api): + """ + Test updating a user location to use internal host detection instead of IP addresses. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_UpdateWithInternalHostDetection + """ + # Create initial location with IP addresses + object_name = f"test-userloc-upd-inthost-{uuid.uuid4().hex[:6]}" + + initial_payload = ForwardingProfileUserLocations( + id="", + name=object_name, + ip_addresses=["10.1.0.0/16"] + ) + + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=initial_payload + ) + + # Update to use internal host detection + internal_host_detection = ForwardingProfileUserLocationsInternalHostDetection( + fqdn="updated.example.com", + ip_address="172.20.1.1" + ) + + update_payload = ForwardingProfileUserLocations( + id=created_obj.id, + name=object_name, + description="Updated to use internal host detection", + internal_host_detection=internal_host_detection + ) + + updated_obj = perform( + user_locations_api.update_global_protect_user_location_by_id, + response_type=ForwardingProfileUserLocations, + id=created_obj.id, + forwarding_profile_user_locations=update_payload + ) + + # Verify + assert updated_obj.name == object_name + assert updated_obj.description == "Updated to use internal host detection" + assert updated_obj.internal_host_detection is not None + assert updated_obj.internal_host_detection.fqdn == "updated.example.com" + assert updated_obj.internal_host_detection.ip_address == "172.20.1.1" + + logger.info(f"Successfully updated ForwardingProfileUserLocations to use internal host detection: {object_name}") + + # Cleanup + perform( + user_locations_api.delete_global_protect_user_location, + id=created_obj.id + ) + + +def test_delete_user_location_by_id(user_locations_api): + """ + Test deletion specifically. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_DeleteByID + We manually create and delete here to verify the delete logic explicitly. + """ + # Setup + object_name = f"test-userloc-delete-{uuid.uuid4().hex[:6]}" + + payload = ForwardingProfileUserLocations( + id="", + name=object_name, + description="Test user location for delete API testing" + ) + + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=payload + ) + + # Perform Delete using helper + perform( + user_locations_api.delete_global_protect_user_location, + id=created_obj.id + ) + + logger.info(f"Successfully deleted ForwardingProfileUserLocations: {created_obj.id}") + + +def test_fetch_user_locations(user_locations_api, clean_user_location): + """ + Test fetching a single user location by name using the fetch convenience method. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_FetchUserLocations + """ + # Test 1: Fetch existing object by name + fetched_obj = user_locations_api.fetch_user_locations( + name=clean_user_location.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found user location '{clean_user_location.name}'" + assert fetched_obj.id == clean_user_location.id + assert fetched_obj.name == clean_user_location.name + logger.info(f"fetch_user_locations found object: {fetched_obj.name}") + + # Test 2: Fetch non-existent object (should return None) + not_found = user_locations_api.fetch_user_locations( + name="non-existent-user-location-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent user location" + logger.info(f"fetch_user_locations correctly returned None for non-existent user location") + + +def test_list_user_locations_pagination(user_locations_api): + """ + Test pagination parameters when listing user locations. + Equivalent to Go: Test_mobile_agent_UserLocationsAPIService_ListPagination + """ + # Create multiple test objects to test pagination + created_ids = [] + random_suffix = uuid.uuid4().hex[:6] + + for i in range(3): + location_name = f"test-userloc-page-{random_suffix}-{i}" + + payload = ForwardingProfileUserLocations( + id="", + name=location_name + ) + + created_obj = perform( + user_locations_api.create_global_protect_user_location_with_http_info, + response_type=ForwardingProfileUserLocations, + folder=TARGET_FOLDER, + forwarding_profile_user_locations=payload + ) + + if created_obj.id: + created_ids.append(created_obj.id) + + # Cleanup created test objects + for location_id in created_ids: + try: + perform( + user_locations_api.delete_global_protect_user_location, + id=location_id + ) + except Exception as e: + logger.warning(f"Failed to cleanup user location {location_id}: {e}") + + # Test with limit + response = perform( + user_locations_api.list_global_protect_user_locations, + folder=TARGET_FOLDER, + limit=2, + offset=0 + ) + + assert response is not None + logger.info(f"Retrieved {len(response.data)} items with limit=2") + + # Test with offset + response2 = perform( + user_locations_api.list_global_protect_user_locations, + folder=TARGET_FOLDER, + limit=10, + offset=1 + ) + + assert response2 is not None + logger.info(f"Retrieved {len(response2.data)} items with offset=1") + logger.info("Pagination test completed successfully") diff --git a/scm/network_services/rest.py b/scm/network_services/rest.py index 5f658184..979bd1af 100644 --- a/scm/network_services/rest.py +++ b/scm/network_services/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/network_services/tests/api_ipsec_crypto_profiles_test.py b/scm/network_services/tests/api_ipsec_crypto_profiles_test.py index 145d8f78..5f63e0ab 100644 --- a/scm/network_services/tests/api_ipsec_crypto_profiles_test.py +++ b/scm/network_services/tests/api_ipsec_crypto_profiles_test.py @@ -167,3 +167,29 @@ def test_delete_ipsec_crypto_profile_by_id(ipsec_api): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_ipsec_crypto_profiles(ipsec_api, clean_ipsec_profile): + """ + Test fetching a single IPsec crypto profile by name using the fetch convenience method. + Equivalent to Go: Test_network_services_IPsecCryptoProfilesAPIService_FetchIPsecCryptoProfiles + """ + # Fetch by exact name + fetched_obj = ipsec_api.fetch_ipsec_crypto_profiles( + name=clean_ipsec_profile.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found profile '{clean_ipsec_profile.name}'" + assert fetched_obj.id == clean_ipsec_profile.id + assert fetched_obj.name == clean_ipsec_profile.name + logger.info(f"\n[SUCCESS] fetch_ipsec_crypto_profiles found object: {fetched_obj.name}") + + # Test fetching non-existent profile (should return None) + not_found = ipsec_api.fetch_ipsec_crypto_profiles( + name="non-existent-ipsec-crypto-profile-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent profile" + logger.info(f"\n[SUCCESS] fetch_ipsec_crypto_profiles correctly returned None for non-existent profile") diff --git a/scm/network_services/tests/api_ipsec_tunnels_test.py b/scm/network_services/tests/api_ipsec_tunnels_test.py index f7f919d1..d6501648 100644 --- a/scm/network_services/tests/api_ipsec_tunnels_test.py +++ b/scm/network_services/tests/api_ipsec_tunnels_test.py @@ -224,3 +224,29 @@ def test_delete_ipsec_tunnel_by_id(tunnel_api, dependency_ike_gateway): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_ipsec_tunnels(tunnel_api, clean_tunnel): + """ + Test fetching a single IPsec tunnel by name using the fetch convenience method. + Equivalent to Go: Test_network_services_IPsecTunnelsAPIService_FetchIPsecTunnels + """ + # Fetch by exact name + fetched_obj = tunnel_api.fetch_ipsec_tunnels( + name=clean_tunnel.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found tunnel '{clean_tunnel.name}'" + assert fetched_obj.id == clean_tunnel.id + assert fetched_obj.name == clean_tunnel.name + logger.info(f"\n[SUCCESS] fetch_ipsec_tunnels found object: {fetched_obj.name}") + + # Test fetching non-existent tunnel (should return None) + not_found = tunnel_api.fetch_ipsec_tunnels( + name="non-existent-ipsec-tunnel-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent tunnel" + logger.info(f"\n[SUCCESS] fetch_ipsec_tunnels correctly returned None for non-existent tunnel") diff --git a/scm/network_services/tests/api_nat_rules_test.py b/scm/network_services/tests/api_nat_rules_test.py index d81477e7..7e2dc3d5 100644 --- a/scm/network_services/tests/api_nat_rules_test.py +++ b/scm/network_services/tests/api_nat_rules_test.py @@ -256,3 +256,31 @@ def test_delete_nat_rule_by_id(nat_rules_api): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_nat_rules(nat_rules_api, clean_nat_rule): + """ + Test fetching a single NAT rule by name using the fetch convenience method. + Equivalent to Go: Test_network_services_NATRulesAPIService_FetchNATRules + """ + # Fetch by exact name (position is required for rules APIs) + fetched_obj = nat_rules_api.fetch_nat_rules( + name=clean_nat_rule.name, + folder=TARGET_FOLDER, + position="pre" + ) + + # Verify + assert fetched_obj is not None, f"Should have found rule '{clean_nat_rule.name}'" + assert fetched_obj.id == clean_nat_rule.id + assert fetched_obj.name == clean_nat_rule.name + logger.info(f"\n[SUCCESS] fetch_nat_rules found object: {fetched_obj.name}") + + # Test fetching non-existent rule (should return None) + not_found = nat_rules_api.fetch_nat_rules( + name="non-existent-nat-rule-xyz-12345", + folder=TARGET_FOLDER, + position="pre" + ) + assert not_found is None, "Should return None for non-existent rule" + logger.info(f"\n[SUCCESS] fetch_nat_rules correctly returned None for non-existent rule") diff --git a/scm/network_services/tests/api_qos_profiles_test.py b/scm/network_services/tests/api_qos_profiles_test.py index 8becde75..114f677d 100644 --- a/scm/network_services/tests/api_qos_profiles_test.py +++ b/scm/network_services/tests/api_qos_profiles_test.py @@ -159,3 +159,29 @@ def test_delete_qos_profile_by_id(qos_profiles_api): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_qos_profiles(qos_profiles_api, clean_qos_profile): + """ + Test fetching a single QoS profile by name using the fetch convenience method. + Equivalent to Go: Test_network_services_QoSProfilesAPIService_FetchQoSProfiles + """ + # Fetch by exact name + fetched_obj = qos_profiles_api.fetch_qos_profiles( + name=clean_qos_profile.name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found profile '{clean_qos_profile.name}'" + assert fetched_obj.id == clean_qos_profile.id + assert fetched_obj.name == clean_qos_profile.name + logger.info(f"\n[SUCCESS] fetch_qos_profiles found object: {fetched_obj.name}") + + # Test fetching non-existent profile (should return None) + not_found = qos_profiles_api.fetch_qos_profiles( + name="non-existent-qos-profile-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent profile" + logger.info(f"\n[SUCCESS] fetch_qos_profiles correctly returned None for non-existent profile") diff --git a/scm/network_services/tests/api_qos_rules_test.py b/scm/network_services/tests/api_qos_rules_test.py index cc47a99b..72ff678b 100644 --- a/scm/network_services/tests/api_qos_rules_test.py +++ b/scm/network_services/tests/api_qos_rules_test.py @@ -127,6 +127,34 @@ def test_delete_qos_rule_by_id(qos_rules_api): logger.info(f" Object ID: {created_obj.id}") +def test_fetch_qos_rules(qos_rules_api, clean_qos_rule): + """ + Test fetching a single QoS rule by name using the fetch convenience method. + Equivalent to Go: Test_network_services_QoSRulesAPIService_FetchQoSRules + """ + # Fetch by exact name (position is required for rules APIs) + fetched_obj = qos_rules_api.fetch_qos_rules( + name=clean_qos_rule.name, + folder=TARGET_FOLDER, + position="pre" + ) + + # Verify + assert fetched_obj is not None, f"Should have found rule '{clean_qos_rule.name}'" + assert fetched_obj.id == clean_qos_rule.id + assert fetched_obj.name == clean_qos_rule.name + logger.info(f"\n[SUCCESS] fetch_qos_rules found object: {fetched_obj.name}") + + # Test fetching non-existent rule (should return None) + not_found = qos_rules_api.fetch_qos_rules( + name="non-existent-qos-rule-xyz-12345", + folder=TARGET_FOLDER, + position="pre" + ) + assert not_found is None, "Should return None for non-existent rule" + logger.info(f"\n[SUCCESS] fetch_qos_rules correctly returned None for non-existent rule") + + def test_move_qos_rule(qos_rules_api): """Test moving a QoS Rule.""" # Create two rules diff --git a/scm/network_services/tests/api_zones_test.py b/scm/network_services/tests/api_zones_test.py index 66efb6bc..67998f3e 100644 --- a/scm/network_services/tests/api_zones_test.py +++ b/scm/network_services/tests/api_zones_test.py @@ -99,7 +99,7 @@ def test_list_zones(zones_api, clean_zone): """Test listing Security Zones.""" response = zones_api.list_zones(folder=TARGET_FOLDER, limit=10) assert len(response.data) > 0 - + found = False for item in response.data: if item.id == clean_zone.id: @@ -108,6 +108,24 @@ def test_list_zones(zones_api, clean_zone): assert found is True +def test_fetch_security_zones(zones_api, clean_zone): + """Test fetching a Security Zone by name using the fetch convenience method.""" + fetched_obj = zones_api.fetch_security_zones( + name=clean_zone.name, + folder=TARGET_FOLDER, + ) + assert fetched_obj is not None + assert fetched_obj.id == clean_zone.id + assert fetched_obj.name == clean_zone.name + logger.info(f"\n[SUCCESS] fetch_security_zones found object: {fetched_obj.name}") + + not_found = zones_api.fetch_security_zones( + name="non-existent-zone-xyz-12345", + folder=TARGET_FOLDER, + ) + assert not_found is None + logger.info(f"\n[SUCCESS] fetch_security_zones correctly returned None for non-existent object") + def test_delete_zone_by_id(zones_api): """Test deleting a Security Zone.""" diff --git a/scm/objects/rest.py b/scm/objects/rest.py index f5a77fd9..021eaf35 100644 --- a/scm/objects/rest.py +++ b/scm/objects/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/objects/tests/api_applications_test.py b/scm/objects/tests/api_applications_test.py index 79e9f827..876008fd 100644 --- a/scm/objects/tests/api_applications_test.py +++ b/scm/objects/tests/api_applications_test.py @@ -213,3 +213,29 @@ def test_delete_application_by_id(applications_api): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_applications(applications_api, clean_application): + """ + Test fetching a single application by name using the fetch convenience method. + Equivalent to Go: Test_objects_ApplicationsAPIService_FetchApplications + """ + # Fetch by exact name + fetched_obj = applications_api.fetch_applications( + name=clean_application.name, + folder=clean_application.folder + ) + + # Verify + assert fetched_obj is not None, f"Should have found application '{clean_application.name}'" + assert fetched_obj.id == clean_application.id + assert fetched_obj.name == clean_application.name + logger.info(f"\n[SUCCESS] fetch_applications found object: {fetched_obj.name}") + + # Test fetching non-existent application (should return None) + not_found = applications_api.fetch_applications( + name="non-existent-application-xyz-12345", + folder=clean_application.folder + ) + assert not_found is None, "Should return None for non-existent application" + logger.info(f"\n[SUCCESS] fetch_applications correctly returned None for non-existent application") diff --git a/scm/objects/tests/api_auto_tag_actions_test.py b/scm/objects/tests/api_auto_tag_actions_test.py new file mode 100644 index 00000000..25f1fd9f --- /dev/null +++ b/scm/objects/tests/api_auto_tag_actions_test.py @@ -0,0 +1,54 @@ + +import logging +import pytest +from scm import Scm + +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger(__name__) + + +@pytest.fixture(scope="module") +def client(): + try: + return Scm(log_level="DEBUG") + except Exception as e: + pytest.skip(f"Skipping tests due to client initialization failure: {e}") + + +@pytest.fixture(scope="module") +def auto_tag_actions_api(client): + return client.objects.AutoTagActionsApi(client.objects.api_client) + + +def test_list_auto_tag_actions(auto_tag_actions_api): + """Test listing auto tag actions.""" + response = auto_tag_actions_api.list_auto_tag_actions() + assert response is not None + logger.info(f"Listed {len(response.data) if response.data else 0} auto tag actions") + + +def test_fetch_auto_tag_actions(auto_tag_actions_api): + """Test fetch method for auto tag actions.""" + # First list to find an existing object + response = auto_tag_actions_api.list_auto_tag_actions() + if response is None or not hasattr(response, 'data') or not response.data: + pytest.skip("No auto tag actions found to test fetch") + + target = response.data[0] + target_name = target.name + logger.info(f"Testing fetch for: {target_name}") + + # Use fetch method + fetched = auto_tag_actions_api.fetch_auto_tag_actions(name=target_name) + assert fetched is not None + assert fetched.name == target_name + logger.info(f"Successfully fetched auto tag action: {fetched.name}") + + +def test_fetch_auto_tag_actions_not_found(auto_tag_actions_api): + """Test fetch returns None for non-existent object.""" + result = auto_tag_actions_api.fetch_auto_tag_actions( + name="non-existent-autotag-xyz-12345", + ) + assert result is None + logger.info("Correctly returned None for non-existent auto tag action") diff --git a/scm/objects/tests/api_regions_test.py b/scm/objects/tests/api_regions_test.py index 17a72eda..1657b7f0 100644 --- a/scm/objects/tests/api_regions_test.py +++ b/scm/objects/tests/api_regions_test.py @@ -16,9 +16,7 @@ TARGET_FOLDER = "Prisma Access" # ----------------------------------------------------------------------------- -# NOTE: Regions do NOT support List or Fetch operations. -# Go removed List/Fetch because predefined regions lack the 'id' field. -# Only Create, GetByID, Update, and DeleteByID are tested. +# NOTE: Regions support Fetch operations for user-created regions. @pytest.fixture(scope="module") @@ -212,3 +210,56 @@ def test_delete_region_by_id(regions_api): except ObjectNotPresentError: logger.info(f"Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_regions(regions_api): + """ + Test fetching a single region by name using the fetch convenience method. + Equivalent to Go: Test_objects_RegionsAPIService_FetchRegions + """ + # Create a region first + random_suffix = uuid.uuid4().hex[:6] + region_name = f"test-rgn-fetch-{random_suffix}" + + payload = Regions( + id="", + name=region_name, + folder=TARGET_FOLDER, + address=["10.100.0.0/16"], + ) + + created_obj = perform( + regions_api.create_regions_with_http_info, + response_type=Regions, + regions=payload, + ) + assert created_obj.id is not None + + try: + # Fetch by exact name + fetched_obj = regions_api.fetch_regions( + name=region_name, + folder=TARGET_FOLDER + ) + + # Verify + assert fetched_obj is not None, f"Should have found region '{region_name}'" + assert fetched_obj.id == created_obj.id + assert fetched_obj.name == region_name + logger.info(f"\n[SUCCESS] fetch_regions found object: {fetched_obj.name}") + + # Test fetching non-existent region (should return None) + not_found = regions_api.fetch_regions( + name="non-existent-region-xyz-12345", + folder=TARGET_FOLDER + ) + assert not_found is None, "Should return None for non-existent region" + logger.info(f"\n[SUCCESS] fetch_regions correctly returned None for non-existent region") + + finally: + # Cleanup + perform( + regions_api.delete_regions_by_id, + id=created_obj.id, + ) + logger.info(f"Successfully cleaned up region: {created_obj.id}") diff --git a/scm/security_services/docs/InternetRuleTypeAllowWebApplicationInner.md b/scm/security_services/docs/InternetRuleTypeAllowWebApplicationInner.md index 3bf22f97..63035787 100644 --- a/scm/security_services/docs/InternetRuleTypeAllowWebApplicationInner.md +++ b/scm/security_services/docs/InternetRuleTypeAllowWebApplicationInner.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**app_id** | **str** | | [optional] **application_function** | **List[str]** | | [optional] **dlp** | **str** | | [optional] **file_control** | [**InternetRuleTypeAllowUrlCategoryInnerFileControl**](InternetRuleTypeAllowUrlCategoryInnerFileControl.md) | | [optional] diff --git a/scm/security_services/models/internet_rule_type_allow_web_application_inner.py b/scm/security_services/models/internet_rule_type_allow_web_application_inner.py index f90e7bcb..37d4f8b8 100644 --- a/scm/security_services/models/internet_rule_type_allow_web_application_inner.py +++ b/scm/security_services/models/internet_rule_type_allow_web_application_inner.py @@ -30,6 +30,7 @@ class InternetRuleTypeAllowWebApplicationInner(BaseModel): """ InternetRuleTypeAllowWebApplicationInner """ # noqa: E501 + app_id: Optional[StrictStr] = None application_function: Optional[List[StrictStr]] = None dlp: Optional[StrictStr] = None file_control: Optional[InternetRuleTypeAllowUrlCategoryInnerFileControl] = None @@ -39,7 +40,7 @@ class InternetRuleTypeAllowWebApplicationInner(BaseModel): saas_user_list: Optional[List[StrictStr]] = None tenant_control: Optional[InternetRuleTypeAllowWebApplicationInnerTenantControl] = None type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["application_function", "dlp", "file_control", "name", "saas_enterprise_control", "saas_tenant_list", "saas_user_list", "tenant_control", "type"] + __properties: ClassVar[List[str]] = ["app_id", "application_function", "dlp", "file_control", "name", "saas_enterprise_control", "saas_tenant_list", "saas_user_list", "tenant_control", "type"] model_config = ConfigDict( populate_by_name=True, @@ -101,6 +102,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "app_id": obj.get("app_id"), "application_function": obj.get("application_function"), "dlp": obj.get("dlp"), "file_control": InternetRuleTypeAllowUrlCategoryInnerFileControl.from_dict(obj["file_control"]) if obj.get("file_control") is not None else None, diff --git a/scm/security_services/rest.py b/scm/security_services/rest.py index 252c8456..b4e7c7c2 100644 --- a/scm/security_services/rest.py +++ b/scm/security_services/rest.py @@ -154,6 +154,12 @@ def request( post_params = post_params or {} headers = headers or {} + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + timeout = None if _request_timeout: if isinstance(_request_timeout, (int, float)): diff --git a/scm/security_services/tests/api_application_override_rules_test.py b/scm/security_services/tests/api_application_override_rules_test.py index bf42d675..bedc403c 100644 --- a/scm/security_services/tests/api_application_override_rules_test.py +++ b/scm/security_services/tests/api_application_override_rules_test.py @@ -206,3 +206,31 @@ def test_delete_application_override_rule_by_id(application_override_rules_api): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_application_override_rules(application_override_rules_api, clean_application_override_rule): + """ + Test fetching a single application override rule by name using the fetch convenience method. + Equivalent to Go: Test_security_services_ApplicationOverrideRulesAPIService_FetchApplicationOverrideRules + """ + # Fetch by exact name (position is required for rules APIs) + fetched_obj = application_override_rules_api.fetch_application_override_rules( + name=clean_application_override_rule.name, + folder=clean_application_override_rule.folder, + position="pre" + ) + + # Verify + assert fetched_obj is not None, f"Should have found rule '{clean_application_override_rule.name}'" + assert fetched_obj.id == clean_application_override_rule.id + assert fetched_obj.name == clean_application_override_rule.name + logger.info(f"\n[SUCCESS] fetch_application_override_rules found object: {fetched_obj.name}") + + # Test fetching non-existent rule (should return None) + not_found = application_override_rules_api.fetch_application_override_rules( + name="non-existent-app-override-rule-xyz-12345", + folder=clean_application_override_rule.folder, + position="pre" + ) + assert not_found is None, "Should return None for non-existent rule" + logger.info(f"\n[SUCCESS] fetch_application_override_rules correctly returned None for non-existent rule") diff --git a/scm/security_services/tests/api_decryption_rules_test.py b/scm/security_services/tests/api_decryption_rules_test.py index 5b6291b7..3337df59 100644 --- a/scm/security_services/tests/api_decryption_rules_test.py +++ b/scm/security_services/tests/api_decryption_rules_test.py @@ -207,3 +207,31 @@ def test_delete_decryption_rule_by_id(decryption_rules_api): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_decryption_rules(decryption_rules_api, clean_decryption_rule): + """ + Test fetching a single decryption rule by name using the fetch convenience method. + Equivalent to Go: Test_security_services_DecryptionRulesAPIService_FetchDecryptionRules + """ + # Fetch by exact name (position is required for rules APIs) + fetched_obj = decryption_rules_api.fetch_decryption_rules( + name=clean_decryption_rule.name, + folder=clean_decryption_rule.folder, + position="pre" + ) + + # Verify + assert fetched_obj is not None, f"Should have found rule '{clean_decryption_rule.name}'" + assert fetched_obj.id == clean_decryption_rule.id + assert fetched_obj.name == clean_decryption_rule.name + logger.info(f"\n[SUCCESS] fetch_decryption_rules found object: {fetched_obj.name}") + + # Test fetching non-existent rule (should return None) + not_found = decryption_rules_api.fetch_decryption_rules( + name="non-existent-decryption-rule-xyz-12345", + folder=clean_decryption_rule.folder, + position="pre" + ) + assert not_found is None, "Should return None for non-existent rule" + logger.info(f"\n[SUCCESS] fetch_decryption_rules correctly returned None for non-existent rule") diff --git a/scm/security_services/tests/api_security_rules_test.py b/scm/security_services/tests/api_security_rules_test.py index 08f5ed6b..b1e1d788 100644 --- a/scm/security_services/tests/api_security_rules_test.py +++ b/scm/security_services/tests/api_security_rules_test.py @@ -229,3 +229,31 @@ def test_delete_security_rule_by_id(security_rules_api): # Exception is already parsed by decorator logger.info(f"✅ Correctly raised ObjectNotPresentError for deleted object") logger.info(f" Object ID: {created_obj.id}") + + +def test_fetch_security_rules(security_rules_api, clean_security_rule): + """ + Test fetching a single security rule by name using the fetch convenience method. + Equivalent to Go: Test_security_services_SecurityRulesAPIService_FetchSecurityRules + """ + # Fetch by exact name (position is required for rules APIs) + fetched_obj = security_rules_api.fetch_security_rules( + name=clean_security_rule.name, + folder=clean_security_rule.folder, + position="pre" + ) + + # Verify + assert fetched_obj is not None, f"Should have found rule '{clean_security_rule.name}'" + assert fetched_obj.id == clean_security_rule.id + assert fetched_obj.name == clean_security_rule.name + logger.info(f"\n[SUCCESS] fetch_security_rules found object: {fetched_obj.name}") + + # Test fetching non-existent rule (should return None) + not_found = security_rules_api.fetch_security_rules( + name="non-existent-security-rule-xyz-12345", + folder=clean_security_rule.folder, + position="pre" + ) + assert not_found is None, "Should return None for non-existent rule" + logger.info(f"\n[SUCCESS] fetch_security_rules correctly returned None for non-existent rule") From 8e22b02e420c80fe8b8f49bf2ac746dc6e519760 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Wed, 27 May 2026 11:11:52 -0700 Subject: [PATCH 02/13] scm action changes --- .../PushCandidateConfigVersionsRequest.md | 2 +- .../push_candidate_config_versions_request.py | 4 +- scm/network_services/__init__.py | 1 + scm/network_services/docs/Lacp.md | 1 + .../docs/LacpHighAvailability.md | 30 +++++++ scm/network_services/models/__init__.py | 1 + scm/network_services/models/lacp.py | 8 +- .../models/lacp_high_availability.py | 88 +++++++++++++++++++ 8 files changed, 131 insertions(+), 4 deletions(-) create mode 100644 scm/network_services/docs/LacpHighAvailability.md create mode 100644 scm/network_services/models/lacp_high_availability.py diff --git a/scm/config_operations/docs/PushCandidateConfigVersionsRequest.md b/scm/config_operations/docs/PushCandidateConfigVersionsRequest.md index 42a99af0..1794792f 100644 --- a/scm/config_operations/docs/PushCandidateConfigVersionsRequest.md +++ b/scm/config_operations/docs/PushCandidateConfigVersionsRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **admin** | **List[str]** | List the administrators and/or service accounts in this field. If you want to push folder named All, please do not add this admin field at all and list each of the folders under All in the folder field. | [optional] **description** | **str** | A description of the changes being pushed | [optional] -**devices** | **List[float]** | The target devices for the configuration push | [optional] +**devices** | **List[str]** | The target devices for the configuration push | [optional] **folder** | **List[str]** | The target folders for the configuration push | [optional] ## Example diff --git a/scm/config_operations/models/push_candidate_config_versions_request.py b/scm/config_operations/models/push_candidate_config_versions_request.py index f0e65b92..a9850d42 100644 --- a/scm/config_operations/models/push_candidate_config_versions_request.py +++ b/scm/config_operations/models/push_candidate_config_versions_request.py @@ -19,7 +19,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self @@ -30,7 +30,7 @@ class PushCandidateConfigVersionsRequest(BaseModel): """ # noqa: E501 admin: Optional[List[StrictStr]] = Field(default=None, description="List the administrators and/or service accounts in this field. If you want to push folder named All, please do not add this admin field at all and list each of the folders under All in the folder field.") description: Optional[StrictStr] = Field(default=None, description="A description of the changes being pushed") - devices: Optional[List[Union[Annotated[float, Field(strict=True)], Annotated[int, Field(strict=True)]]]] = Field(default=None, description="The target devices for the configuration push") + devices: Optional[List[StrictStr]] = Field(default=None, description="The target devices for the configuration push") folder: Optional[List[Annotated[str, Field(strict=True, max_length=64)]]] = Field(default=None, description="The target folders for the configuration push") __properties: ClassVar[List[str]] = ["admin", "description", "devices", "folder"] diff --git a/scm/network_services/__init__.py b/scm/network_services/__init__.py index 797a9baa..db0c6c28 100644 --- a/scm/network_services/__init__.py +++ b/scm/network_services/__init__.py @@ -309,6 +309,7 @@ from scm.network_services.models.iptag_match_list_list_response import IptagMatchListListResponse from scm.network_services.models.lldp_profiles_list_response import LLDPProfilesListResponse from scm.network_services.models.lacp import Lacp +from scm.network_services.models.lacp_high_availability import LacpHighAvailability from scm.network_services.models.layer2_subinterfaces import Layer2Subinterfaces from scm.network_services.models.layer2_subinterfaces_list_response import Layer2SubinterfacesListResponse from scm.network_services.models.layer3_sub_interfaces_dhcp_client import Layer3SubInterfacesDhcpClient diff --git a/scm/network_services/docs/Lacp.md b/scm/network_services/docs/Lacp.md index 21e1058e..80402e68 100644 --- a/scm/network_services/docs/Lacp.md +++ b/scm/network_services/docs/Lacp.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enable** | **bool** | Enable LACP? | [optional] [default to False] **fast_failover** | **bool** | Fast failover | [optional] [default to False] +**high_availability** | [**LacpHighAvailability**](LacpHighAvailability.md) | | [optional] **max_ports** | **int** | Maximum number of physical ports bundled in the LAG | [optional] [default to 8] **mode** | **str** | Mode | [optional] [default to 'passive'] **system_priority** | **int** | LACP system priority in system ID | [optional] [default to 32768] diff --git a/scm/network_services/docs/LacpHighAvailability.md b/scm/network_services/docs/LacpHighAvailability.md new file mode 100644 index 00000000..080e9dc7 --- /dev/null +++ b/scm/network_services/docs/LacpHighAvailability.md @@ -0,0 +1,30 @@ +# LacpHighAvailability + +High Availability settings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**passive_pre_negotiation** | **bool** | | [optional] [default to False] + +## Example + +```python +from scm.network_services.models.lacp_high_availability import LacpHighAvailability + +# TODO update the JSON string below +json = "{}" +# create an instance of LacpHighAvailability from a JSON string +lacp_high_availability_instance = LacpHighAvailability.from_json(json) +# print the JSON string representation of the object +print(LacpHighAvailability.to_json()) + +# convert the object into a dict +lacp_high_availability_dict = lacp_high_availability_instance.to_dict() +# create an instance of LacpHighAvailability from a dict +lacp_high_availability_from_dict = LacpHighAvailability.from_dict(lacp_high_availability_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/scm/network_services/models/__init__.py b/scm/network_services/models/__init__.py index 51416ba5..e319ec8e 100644 --- a/scm/network_services/models/__init__.py +++ b/scm/network_services/models/__init__.py @@ -243,6 +243,7 @@ from scm.network_services.models.iptag_match_list_list_response import IptagMatchListListResponse from scm.network_services.models.lldp_profiles_list_response import LLDPProfilesListResponse from scm.network_services.models.lacp import Lacp +from scm.network_services.models.lacp_high_availability import LacpHighAvailability from scm.network_services.models.layer2_subinterfaces import Layer2Subinterfaces from scm.network_services.models.layer2_subinterfaces_list_response import Layer2SubinterfacesListResponse from scm.network_services.models.layer3_sub_interfaces_dhcp_client import Layer3SubInterfacesDhcpClient diff --git a/scm/network_services/models/lacp.py b/scm/network_services/models/lacp.py index 1a44d1df..081f4ecc 100644 --- a/scm/network_services/models/lacp.py +++ b/scm/network_services/models/lacp.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from scm.network_services.models.lacp_high_availability import LacpHighAvailability from typing import Optional, Set from typing_extensions import Self @@ -30,11 +31,12 @@ class Lacp(BaseModel): """ # noqa: E501 enable: Optional[StrictBool] = Field(default=False, description="Enable LACP?") fast_failover: Optional[StrictBool] = Field(default=False, description="Fast failover") + high_availability: Optional[LacpHighAvailability] = None max_ports: Optional[Annotated[int, Field(le=8, strict=True, ge=1)]] = Field(default=8, description="Maximum number of physical ports bundled in the LAG") mode: Optional[StrictStr] = Field(default='passive', description="Mode") system_priority: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(default=32768, description="LACP system priority in system ID") transmission_rate: Optional[StrictStr] = Field(default='slow', description="Transmission mode") - __properties: ClassVar[List[str]] = ["enable", "fast_failover", "max_ports", "mode", "system_priority", "transmission_rate"] + __properties: ClassVar[List[str]] = ["enable", "fast_failover", "high_availability", "max_ports", "mode", "system_priority", "transmission_rate"] @field_validator('mode') def mode_validate_enum(cls, value): @@ -95,6 +97,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of high_availability + if self.high_availability: + _dict['high_availability'] = self.high_availability.to_dict() return _dict @classmethod @@ -109,6 +114,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "enable": obj.get("enable") if obj.get("enable") is not None else False, "fast_failover": obj.get("fast_failover") if obj.get("fast_failover") is not None else False, + "high_availability": LacpHighAvailability.from_dict(obj["high_availability"]) if obj.get("high_availability") is not None else None, "max_ports": obj.get("max_ports") if obj.get("max_ports") is not None else 8, "mode": obj.get("mode") if obj.get("mode") is not None else 'passive', "system_priority": obj.get("system_priority") if obj.get("system_priority") is not None else 32768, diff --git a/scm/network_services/models/lacp_high_availability.py b/scm/network_services/models/lacp_high_availability.py new file mode 100644 index 00000000..f12662aa --- /dev/null +++ b/scm/network_services/models/lacp_high_availability.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Network Services + + These APIs are used for defining and managing network services configuration within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class LacpHighAvailability(BaseModel): + """ + High Availability settings + """ # noqa: E501 + passive_pre_negotiation: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["passive_pre_negotiation"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LacpHighAvailability from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 LacpHighAvailability from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "passive_pre_negotiation": obj.get("passive_pre_negotiation") if obj.get("passive_pre_negotiation") is not None else False + }) + return _obj + + From 2df0ced2b5c3a675684b1ad800f3bf055f559034 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Fri, 29 May 2026 14:02:46 -0700 Subject: [PATCH 03/13] fix tests --- .../tests/api_config_match_lists_test.py | 85 +++++++++++++++++-- .../api_globalprotect_match_lists_test.py | 84 ++++++++++++++++-- .../tests/api_hipmatch_match_lists_test.py | 84 ++++++++++++++++-- .../tests/api_ipsec_tunnels_test.py | 4 + .../tests/api_iptag_match_lists_test.py | 84 ++++++++++++++++-- .../tests/api_system_match_lists_test.py | 84 ++++++++++++++++-- .../tests/api_userid_match_lists_test.py | 84 ++++++++++++++++-- scm/objects/__init__.py | 6 -- scm/objects/api/__init__.py | 1 - scm/objects/models/__init__.py | 5 -- scm/security_services/__init__.py | 6 ++ scm/security_services/api/__init__.py | 1 + .../api/auto_tag_actions_api.py | 14 +-- .../docs/AutoTagActions.md | 2 +- .../docs/AutoTagActionsActionsInner.md | 2 +- .../docs/AutoTagActionsActionsInnerType.md | 2 +- .../AutoTagActionsActionsInnerTypeTagging.md | 2 +- .../docs/AutoTagActionsApi.md | 78 ++++++++--------- .../docs/AutoTagActionsListResponse.md | 2 +- .../docs/DosProtectionProfilesFloodIcmpRed.md | 6 +- ...ProtectionProfilesFloodTcpSynSynCookies.md | 6 +- scm/security_services/models/__init__.py | 5 ++ .../models/auto_tag_actions.py | 6 +- .../models/auto_tag_actions_actions_inner.py | 6 +- .../auto_tag_actions_actions_inner_type.py | 6 +- ..._tag_actions_actions_inner_type_tagging.py | 4 +- .../models/auto_tag_actions_list_response.py | 6 +- .../dos_protection_profiles_flood_icmp_red.py | 6 +- ...tion_profiles_flood_tcp_syn_syn_cookies.py | 6 +- 29 files changed, 550 insertions(+), 137 deletions(-) rename scm/{objects => security_services}/api/auto_tag_actions_api.py (98%) rename scm/{objects => security_services}/docs/AutoTagActions.md (95%) rename scm/{objects => security_services}/docs/AutoTagActionsActionsInner.md (91%) rename scm/{objects => security_services}/docs/AutoTagActionsActionsInnerType.md (90%) rename scm/{objects => security_services}/docs/AutoTagActionsActionsInnerTypeTagging.md (91%) rename scm/{objects => security_services}/docs/AutoTagActionsApi.md (80%) rename scm/{objects => security_services}/docs/AutoTagActionsListResponse.md (92%) rename scm/{objects => security_services}/models/auto_tag_actions.py (95%) rename scm/{objects => security_services}/models/auto_tag_actions_actions_inner.py (91%) rename scm/{objects => security_services}/models/auto_tag_actions_actions_inner_type.py (91%) rename scm/{objects => security_services}/models/auto_tag_actions_actions_inner_type_tagging.py (96%) rename scm/{objects => security_services}/models/auto_tag_actions_list_response.py (94%) diff --git a/scm/network_services/tests/api_config_match_lists_test.py b/scm/network_services/tests/api_config_match_lists_test.py index 4a05c924..bbedd385 100644 --- a/scm/network_services/tests/api_config_match_lists_test.py +++ b/scm/network_services/tests/api_config_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.config_match_list import ConfigMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,77 @@ def config_match_list_api(client): return client.network_services.ConfigMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for Config Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_config_match_list(config_match_list_api): +def clean_config_match_list(config_match_list_api, dependency_profiles): """ Fixture to create a temporary config match list for testing and automatically delete it after. """ @@ -38,10 +109,8 @@ def clean_config_match_list(config_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -66,7 +135,7 @@ def clean_config_match_list(config_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_config_match_list(config_match_list_api): +def test_create_config_match_list(config_match_list_api, dependency_profiles): """ Test manual creation and deletion of a config match list. """ @@ -77,7 +146,7 @@ def test_create_config_match_list(config_match_list_api): folder=TARGET_FOLDER, description="Test config match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) @@ -167,7 +236,7 @@ def test_fetch_config_match_list(config_match_list_api, clean_config_match_list) logger.info(f"\n[SUCCESS] fetch_config_match_list correctly returned None for non-existent object") -def test_delete_config_match_list_by_id(config_match_list_api): +def test_delete_config_match_list_by_id(config_match_list_api, dependency_profiles): """ Test deletion specifically. """ diff --git a/scm/network_services/tests/api_globalprotect_match_lists_test.py b/scm/network_services/tests/api_globalprotect_match_lists_test.py index deee08fb..0094bb30 100644 --- a/scm/network_services/tests/api_globalprotect_match_lists_test.py +++ b/scm/network_services/tests/api_globalprotect_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.globalprotect_match_list import GlobalprotectMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,77 @@ def globalprotect_match_list_api(client): return client.network_services.GlobalprotectMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for GlobalProtect Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_globalprotect_match_list(globalprotect_match_list_api): +def clean_globalprotect_match_list(globalprotect_match_list_api, dependency_profiles): """ Fixture to create a temporary globalprotect match list for testing and automatically delete it after. """ @@ -38,11 +109,8 @@ def clean_globalprotect_match_list(globalprotect_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +135,7 @@ def clean_globalprotect_match_list(globalprotect_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_globalprotect_match_list(globalprotect_match_list_api): +def test_create_globalprotect_match_list(globalprotect_match_list_api, dependency_profiles): """ Test manual creation and deletion of a globalprotect match list. """ @@ -78,7 +146,7 @@ def test_create_globalprotect_match_list(globalprotect_match_list_api): folder=TARGET_FOLDER, description="Test globalprotect match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_hipmatch_match_lists_test.py b/scm/network_services/tests/api_hipmatch_match_lists_test.py index 7de89c84..44ff9cfd 100644 --- a/scm/network_services/tests/api_hipmatch_match_lists_test.py +++ b/scm/network_services/tests/api_hipmatch_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.hipmatch_match_list import HipmatchMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,77 @@ def hipmatch_match_list_api(client): return client.network_services.HipmatchMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for HIP Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_hipmatch_match_list(hipmatch_match_list_api): +def clean_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): """ Fixture to create a temporary hipmatch match list for testing and automatically delete it after. """ @@ -38,11 +109,8 @@ def clean_hipmatch_match_list(hipmatch_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +135,7 @@ def clean_hipmatch_match_list(hipmatch_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_hipmatch_match_list(hipmatch_match_list_api): +def test_create_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): """ Test manual creation and deletion of a hipmatch match list. """ @@ -78,7 +146,7 @@ def test_create_hipmatch_match_list(hipmatch_match_list_api): folder=TARGET_FOLDER, description="Test hipmatch match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_ipsec_tunnels_test.py b/scm/network_services/tests/api_ipsec_tunnels_test.py index d6501648..7eb18f27 100644 --- a/scm/network_services/tests/api_ipsec_tunnels_test.py +++ b/scm/network_services/tests/api_ipsec_tunnels_test.py @@ -12,6 +12,8 @@ IkeGatewaysAuthentication, IkeGatewaysAuthenticationPreSharedKey, IkeGatewaysPeerAddress, + IkeGatewaysPeerId, + IkeGatewaysLocalId, IkeGatewaysProtocol, IkeGatewaysProtocolIkev1, IkeCryptoProfiles, @@ -69,6 +71,8 @@ def dependency_ike_gateway(ike_gw_api, ike_crypto_api): pre_shared_key=IkeGatewaysAuthenticationPreSharedKey(key="secret123") ), peer_address=IkeGatewaysPeerAddress(ip="1.1.1.1"), + peer_id=IkeGatewaysPeerId(type="ipaddr", id="10.3.3.4"), + local_id=IkeGatewaysLocalId(type="ipaddr", id="10.3.4.4"), protocol=IkeGatewaysProtocol( ikev1=IkeGatewaysProtocolIkev1(ike_crypto_profile=crypto_name), version="ikev1" diff --git a/scm/network_services/tests/api_iptag_match_lists_test.py b/scm/network_services/tests/api_iptag_match_lists_test.py index 37650b17..ac4d2831 100644 --- a/scm/network_services/tests/api_iptag_match_lists_test.py +++ b/scm/network_services/tests/api_iptag_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.iptag_match_list import IptagMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,77 @@ def iptag_match_list_api(client): return client.network_services.IptagMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for IP Tag Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_iptag_match_list(iptag_match_list_api): +def clean_iptag_match_list(iptag_match_list_api, dependency_profiles): """ Fixture to create a temporary iptag match list for testing and automatically delete it after. """ @@ -38,11 +109,8 @@ def clean_iptag_match_list(iptag_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +135,7 @@ def clean_iptag_match_list(iptag_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_iptag_match_list(iptag_match_list_api): +def test_create_iptag_match_list(iptag_match_list_api, dependency_profiles): """ Test manual creation and deletion of an iptag match list. """ @@ -78,7 +146,7 @@ def test_create_iptag_match_list(iptag_match_list_api): folder=TARGET_FOLDER, description="Test iptag match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_system_match_lists_test.py b/scm/network_services/tests/api_system_match_lists_test.py index 523f862e..460acfdd 100644 --- a/scm/network_services/tests/api_system_match_lists_test.py +++ b/scm/network_services/tests/api_system_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.system_match_list import SystemMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,77 @@ def system_match_list_api(client): return client.network_services.SystemMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for System Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_system_match_list(system_match_list_api): +def clean_system_match_list(system_match_list_api, dependency_profiles): """ Fixture to create a temporary system match list for testing and automatically delete it after. """ @@ -38,11 +109,8 @@ def clean_system_match_list(system_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +135,7 @@ def clean_system_match_list(system_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_system_match_list(system_match_list_api): +def test_create_system_match_list(system_match_list_api, dependency_profiles): """ Test manual creation and deletion of a system match list. """ @@ -78,7 +146,7 @@ def test_create_system_match_list(system_match_list_api): folder=TARGET_FOLDER, description="Test system match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_userid_match_lists_test.py b/scm/network_services/tests/api_userid_match_lists_test.py index 4046b15b..3c9e7b72 100644 --- a/scm/network_services/tests/api_userid_match_lists_test.py +++ b/scm/network_services/tests/api_userid_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.userid_match_list import UseridMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,77 @@ def userid_match_list_api(client): return client.network_services.UseridMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for User ID Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_userid_match_list(userid_match_list_api): +def clean_userid_match_list(userid_match_list_api, dependency_profiles): """ Fixture to create a temporary userid match list for testing and automatically delete it after. """ @@ -38,11 +109,8 @@ def clean_userid_match_list(userid_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +135,7 @@ def clean_userid_match_list(userid_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_userid_match_list(userid_match_list_api): +def test_create_userid_match_list(userid_match_list_api, dependency_profiles): """ Test manual creation and deletion of a userid match list. """ @@ -78,7 +146,7 @@ def test_create_userid_match_list(userid_match_list_api): folder=TARGET_FOLDER, description="Test userid match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/objects/__init__.py b/scm/objects/__init__.py index 5705afe1..39ba59ae 100644 --- a/scm/objects/__init__.py +++ b/scm/objects/__init__.py @@ -23,7 +23,6 @@ from scm.objects.api.application_filters_api import ApplicationFiltersApi from scm.objects.api.application_groups_api import ApplicationGroupsApi from scm.objects.api.applications_api import ApplicationsApi -from scm.objects.api.auto_tag_actions_api import AutoTagActionsApi from scm.objects.api.dynamic_user_groups_api import DynamicUserGroupsApi from scm.objects.api.external_dynamic_lists_api import ExternalDynamicListsApi from scm.objects.api.hip_objects_api import HIPObjectsApi @@ -72,11 +71,6 @@ from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThan from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than_qualifier_inner import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThanQualifierInner from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_pattern_match import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorPatternMatch -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.objects.models.dynamic_user_groups import DynamicUserGroups from scm.objects.models.dynamic_user_groups_list_response import DynamicUserGroupsListResponse from scm.objects.models.error_detail_cause_info import ErrorDetailCauseInfo diff --git a/scm/objects/api/__init__.py b/scm/objects/api/__init__.py index e4e18ed0..6d622512 100644 --- a/scm/objects/api/__init__.py +++ b/scm/objects/api/__init__.py @@ -6,7 +6,6 @@ from scm.objects.api.application_filters_api import ApplicationFiltersApi from scm.objects.api.application_groups_api import ApplicationGroupsApi from scm.objects.api.applications_api import ApplicationsApi -from scm.objects.api.auto_tag_actions_api import AutoTagActionsApi from scm.objects.api.dynamic_user_groups_api import DynamicUserGroupsApi from scm.objects.api.external_dynamic_lists_api import ExternalDynamicListsApi from scm.objects.api.hip_objects_api import HIPObjectsApi diff --git a/scm/objects/models/__init__.py b/scm/objects/models/__init__.py index fd0e820e..0e9163d8 100644 --- a/scm/objects/models/__init__.py +++ b/scm/objects/models/__init__.py @@ -37,11 +37,6 @@ from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThan from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than_qualifier_inner import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThanQualifierInner from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_pattern_match import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorPatternMatch -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.objects.models.dynamic_user_groups import DynamicUserGroups from scm.objects.models.dynamic_user_groups_list_response import DynamicUserGroupsListResponse from scm.objects.models.error_detail_cause_info import ErrorDetailCauseInfo diff --git a/scm/security_services/__init__.py b/scm/security_services/__init__.py index e0370840..f0211513 100644 --- a/scm/security_services/__init__.py +++ b/scm/security_services/__init__.py @@ -21,6 +21,7 @@ from scm.security_services.api.anti_spyware_profiles_api import AntiSpywareProfilesApi from scm.security_services.api.anti_spyware_signatures_api import AntiSpywareSignaturesApi from scm.security_services.api.application_override_rules_api import ApplicationOverrideRulesApi +from scm.security_services.api.auto_tag_actions_api import AutoTagActionsApi from scm.security_services.api.dns_security_profiles_api import DNSSecurityProfilesApi from scm.security_services.api.data_filtering_api import DataFilteringApi from scm.security_services.api.data_objects_api import DataObjectsApi @@ -83,6 +84,11 @@ from scm.security_services.models.anti_spyware_signatures_signature_standard_inner_and_condition_inner_or_condition_inner_operator_pattern_match import AntiSpywareSignaturesSignatureStandardInnerAndConditionInnerOrConditionInnerOperatorPatternMatch from scm.security_services.models.app_override_rules import AppOverrideRules from scm.security_services.models.application_override_rules_list_response import ApplicationOverrideRulesListResponse +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.security_services.models.base_rule_properties import BaseRuleProperties from scm.security_services.models.dns_security_profiles_list_response import DNSSecurityProfilesListResponse from scm.security_services.models.data_filtering_profiles import DataFilteringProfiles diff --git a/scm/security_services/api/__init__.py b/scm/security_services/api/__init__.py index 65c8fe5f..3637b815 100644 --- a/scm/security_services/api/__init__.py +++ b/scm/security_services/api/__init__.py @@ -4,6 +4,7 @@ from scm.security_services.api.anti_spyware_profiles_api import AntiSpywareProfilesApi from scm.security_services.api.anti_spyware_signatures_api import AntiSpywareSignaturesApi from scm.security_services.api.application_override_rules_api import ApplicationOverrideRulesApi +from scm.security_services.api.auto_tag_actions_api import AutoTagActionsApi from scm.security_services.api.dns_security_profiles_api import DNSSecurityProfilesApi from scm.security_services.api.data_filtering_api import DataFilteringApi from scm.security_services.api.data_objects_api import DataObjectsApi diff --git a/scm/objects/api/auto_tag_actions_api.py b/scm/security_services/api/auto_tag_actions_api.py similarity index 98% rename from scm/objects/api/auto_tag_actions_api.py rename to scm/security_services/api/auto_tag_actions_api.py index f3637a35..31f730f1 100644 --- a/scm/objects/api/auto_tag_actions_api.py +++ b/scm/security_services/api/auto_tag_actions_api.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,12 +20,12 @@ from pydantic import Field, StrictInt, StrictStr from typing import Optional from typing_extensions import Annotated -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse -from scm.objects.api_client import ApiClient, RequestSerialized -from scm.objects.api_response import ApiResponse -from scm.objects.rest import RESTResponseType +from scm.security_services.api_client import ApiClient, RequestSerialized +from scm.security_services.api_response import ApiResponse +from scm.security_services.rest import RESTResponseType from scm.decorators import with_error_handling diff --git a/scm/objects/docs/AutoTagActions.md b/scm/security_services/docs/AutoTagActions.md similarity index 95% rename from scm/objects/docs/AutoTagActions.md rename to scm/security_services/docs/AutoTagActions.md index 9cd21935..2dbd2a41 100644 --- a/scm/objects/docs/AutoTagActions.md +++ b/scm/security_services/docs/AutoTagActions.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions import AutoTagActions # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsActionsInner.md b/scm/security_services/docs/AutoTagActionsActionsInner.md similarity index 91% rename from scm/objects/docs/AutoTagActionsActionsInner.md rename to scm/security_services/docs/AutoTagActionsActionsInner.md index 5758581c..f26577f7 100644 --- a/scm/objects/docs/AutoTagActionsActionsInner.md +++ b/scm/security_services/docs/AutoTagActionsActionsInner.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsActionsInnerType.md b/scm/security_services/docs/AutoTagActionsActionsInnerType.md similarity index 90% rename from scm/objects/docs/AutoTagActionsActionsInnerType.md rename to scm/security_services/docs/AutoTagActionsActionsInnerType.md index 3ed205e2..f04a5fed 100644 --- a/scm/objects/docs/AutoTagActionsActionsInnerType.md +++ b/scm/security_services/docs/AutoTagActionsActionsInnerType.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md b/scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md similarity index 91% rename from scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md rename to scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md index 65b6e013..71335cda 100644 --- a/scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md +++ b/scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsApi.md b/scm/security_services/docs/AutoTagActionsApi.md similarity index 80% rename from scm/objects/docs/AutoTagActionsApi.md rename to scm/security_services/docs/AutoTagActionsApi.md index fb2243d5..233f7575 100644 --- a/scm/objects/docs/AutoTagActionsApi.md +++ b/scm/security_services/docs/AutoTagActionsApi.md @@ -1,6 +1,6 @@ -# scm.objects.AutoTagActionsApi +# scm.security_services.AutoTagActionsApi -All URIs are relative to *https://api.strata.paloaltonetworks.com/config/objects/v1* +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/security/v1* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -22,15 +22,15 @@ Create a new auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -39,15 +39,15 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) - auto_tag_actions = scm.objects.AutoTagActions() # AutoTagActions | Created (optional) + api_instance = scm.security_services.AutoTagActionsApi(api_client) + auto_tag_actions = scm.security_services.AutoTagActions() # AutoTagActions | Created (optional) try: # Create an auto-tag action @@ -105,14 +105,14 @@ Delete an auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -121,14 +121,14 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) + api_instance = scm.security_services.AutoTagActionsApi(api_client) name = 'name_example' # str | The name of the configuration resource try: @@ -186,15 +186,15 @@ Retrieve a list of auto-tag actions * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -203,14 +203,14 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) + api_instance = scm.security_services.AutoTagActionsApi(api_client) name = 'name_example' # str | The name of the configuration resource (optional) offset = 0 # int | The offset into the list of results returned (optional) (default to 0) limit = 200 # int | The maximum number of results per page (optional) (default to 200) @@ -273,15 +273,15 @@ Update an existing auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -290,15 +290,15 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) - auto_tag_actions = scm.objects.AutoTagActions() # AutoTagActions | OK (optional) + api_instance = scm.security_services.AutoTagActionsApi(api_client) + auto_tag_actions = scm.security_services.AutoTagActions() # AutoTagActions | OK (optional) try: # Update an auto-tag action diff --git a/scm/objects/docs/AutoTagActionsListResponse.md b/scm/security_services/docs/AutoTagActionsListResponse.md similarity index 92% rename from scm/objects/docs/AutoTagActionsListResponse.md rename to scm/security_services/docs/AutoTagActionsListResponse.md index 5712e845..087a90cf 100644 --- a/scm/objects/docs/AutoTagActionsListResponse.md +++ b/scm/security_services/docs/AutoTagActionsListResponse.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse # TODO update the JSON string below json = "{}" diff --git a/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md b/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md index c2a0ce79..ba0496d4 100644 --- a/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md +++ b/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activate_rate** | **int** | Connection rate (cps) to start RED | [default to 10000] -**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [default to 10000] +**activate_rate** | **int** | Connection rate (cps) to start RED | [optional] [default to 10000] +**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [optional] [default to 10000] **block** | [**DosProtectionProfilesFloodIcmpRedBlock**](DosProtectionProfilesFloodIcmpRedBlock.md) | | [optional] -**maximal_rate** | **int** | Maximal connection rate (cps) allowed | [default to 40000] +**maximal_rate** | **int** | Maximal connection rate (cps) allowed | [optional] [default to 40000] ## Example diff --git a/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md b/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md index a680ace9..207e61a4 100644 --- a/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md +++ b/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activate_rate** | **int** | Connection rate (cps) to activate SYN cookies proxy | [default to 0] -**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [default to 10000] +**activate_rate** | **int** | Connection rate (cps) to activate SYN cookies proxy | [optional] [default to 0] +**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [optional] [default to 10000] **block** | [**DosProtectionProfilesFloodTcpSynSynCookiesBlock**](DosProtectionProfilesFloodTcpSynSynCookiesBlock.md) | | [optional] -**maximal_rate** | **int** | Maximum connection rate (cps) allowed | [default to 1000000] +**maximal_rate** | **int** | Maximum connection rate (cps) allowed | [optional] [default to 1000000] ## Example diff --git a/scm/security_services/models/__init__.py b/scm/security_services/models/__init__.py index 4dba277a..202c93f3 100644 --- a/scm/security_services/models/__init__.py +++ b/scm/security_services/models/__init__.py @@ -44,6 +44,11 @@ from scm.security_services.models.anti_spyware_signatures_signature_standard_inner_and_condition_inner_or_condition_inner_operator_pattern_match import AntiSpywareSignaturesSignatureStandardInnerAndConditionInnerOrConditionInnerOperatorPatternMatch from scm.security_services.models.app_override_rules import AppOverrideRules from scm.security_services.models.application_override_rules_list_response import ApplicationOverrideRulesListResponse +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.security_services.models.base_rule_properties import BaseRuleProperties from scm.security_services.models.dns_security_profiles_list_response import DNSSecurityProfilesListResponse from scm.security_services.models.data_filtering_profiles import DataFilteringProfiles diff --git a/scm/objects/models/auto_tag_actions.py b/scm/security_services/models/auto_tag_actions.py similarity index 95% rename from scm/objects/models/auto_tag_actions.py rename to scm/security_services/models/auto_tag_actions.py index 9877b9fe..d3ced581 100644 --- a/scm/objects/models/auto_tag_actions.py +++ b/scm/security_services/models/auto_tag_actions.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner from typing import Optional, Set from typing_extensions import Self diff --git a/scm/objects/models/auto_tag_actions_actions_inner.py b/scm/security_services/models/auto_tag_actions_actions_inner.py similarity index 91% rename from scm/objects/models/auto_tag_actions_actions_inner.py rename to scm/security_services/models/auto_tag_actions_actions_inner.py index 359782f8..dc2e6c84 100644 --- a/scm/objects/models/auto_tag_actions_actions_inner.py +++ b/scm/security_services/models/auto_tag_actions_actions_inner.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType from typing import Optional, Set from typing_extensions import Self diff --git a/scm/objects/models/auto_tag_actions_actions_inner_type.py b/scm/security_services/models/auto_tag_actions_actions_inner_type.py similarity index 91% rename from scm/objects/models/auto_tag_actions_actions_inner_type.py rename to scm/security_services/models/auto_tag_actions_actions_inner_type.py index ce63a501..74a6f828 100644 --- a/scm/objects/models/auto_tag_actions_actions_inner_type.py +++ b/scm/security_services/models/auto_tag_actions_actions_inner_type.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging from typing import Optional, Set from typing_extensions import Self diff --git a/scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py b/scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py similarity index 96% rename from scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py rename to scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py index f28d1c1d..4f5386ee 100644 --- a/scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py +++ b/scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com diff --git a/scm/objects/models/auto_tag_actions_list_response.py b/scm/security_services/models/auto_tag_actions_list_response.py similarity index 94% rename from scm/objects/models/auto_tag_actions_list_response.py rename to scm/security_services/models/auto_tag_actions_list_response.py index 126c221e..75c1ae6d 100644 --- a/scm/objects/models/auto_tag_actions_list_response.py +++ b/scm/security_services/models/auto_tag_actions_list_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List -from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions import AutoTagActions from typing import Optional, Set from typing_extensions import Self diff --git a/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py b/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py index 1ec8e9cf..b00b01be 100644 --- a/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py +++ b/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py @@ -29,10 +29,10 @@ class DosProtectionProfilesFloodIcmpRed(BaseModel): """ DosProtectionProfilesFloodIcmpRed """ # noqa: E501 - activate_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Connection rate (cps) to start RED", alias="activate-rate") - alarm_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to generate alarm", alias="alarm-rate") + activate_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=10000, description="Connection rate (cps) to start RED", alias="activate-rate") + alarm_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=10000, description="Connection rate (cps) to generate alarm", alias="alarm-rate") block: Optional[DosProtectionProfilesFloodIcmpRedBlock] = None - maximal_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Maximal connection rate (cps) allowed", alias="maximal-rate") + maximal_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=40000, description="Maximal connection rate (cps) allowed", alias="maximal-rate") __properties: ClassVar[List[str]] = ["activate-rate", "alarm-rate", "block", "maximal-rate"] model_config = ConfigDict( diff --git a/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py b/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py index 6c96babf..4d1cf2b8 100644 --- a/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py +++ b/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py @@ -29,10 +29,10 @@ class DosProtectionProfilesFloodTcpSynSynCookies(BaseModel): """ DosProtectionProfilesFloodTcpSynSynCookies """ # noqa: E501 - activate_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to activate SYN cookies proxy", alias="activate-rate") - alarm_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to generate alarm", alias="alarm-rate") + activate_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=0, description="Connection rate (cps) to activate SYN cookies proxy", alias="activate-rate") + alarm_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=10000, description="Connection rate (cps) to generate alarm", alias="alarm-rate") block: Optional[DosProtectionProfilesFloodTcpSynSynCookiesBlock] = None - maximal_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Maximum connection rate (cps) allowed", alias="maximal-rate") + maximal_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=1000000, description="Maximum connection rate (cps) allowed", alias="maximal-rate") __properties: ClassVar[List[str]] = ["activate-rate", "alarm-rate", "block", "maximal-rate"] model_config = ConfigDict( From 08505204e113408f5f82a84cc8ee0a8679de5414 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Fri, 29 May 2026 14:50:15 -0700 Subject: [PATCH 04/13] fix failing tests --- scm/network_services/tests/api_config_match_lists_test.py | 2 ++ .../tests/api_globalprotect_match_lists_test.py | 2 ++ scm/network_services/tests/api_hipmatch_match_lists_test.py | 2 ++ scm/network_services/tests/api_iptag_match_lists_test.py | 2 ++ scm/network_services/tests/api_system_match_lists_test.py | 2 ++ scm/network_services/tests/api_userid_match_lists_test.py | 2 ++ scm/objects/tests/api_auto_tag_actions_test.py | 2 +- 7 files changed, 13 insertions(+), 1 deletion(-) diff --git a/scm/network_services/tests/api_config_match_lists_test.py b/scm/network_services/tests/api_config_match_lists_test.py index bbedd385..8d3985f4 100644 --- a/scm/network_services/tests/api_config_match_lists_test.py +++ b/scm/network_services/tests/api_config_match_lists_test.py @@ -47,6 +47,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create HTTP Server Profile http_name = f"test-http-{random_id}" http_payload = HttpServerProfiles( + id="", name=http_name, folder=TARGET_FOLDER, server=[HttpServerProfilesServerInner( @@ -63,6 +64,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create Syslog Server Profile (shortened name to stay under 31 char limit) syslog_name = f"sys-{random_id}" syslog_payload = SyslogServerProfiles( + id="", name=syslog_name, folder=TARGET_FOLDER, server=[SyslogServerProfilesServerInner( diff --git a/scm/network_services/tests/api_globalprotect_match_lists_test.py b/scm/network_services/tests/api_globalprotect_match_lists_test.py index 0094bb30..e6ebeb8f 100644 --- a/scm/network_services/tests/api_globalprotect_match_lists_test.py +++ b/scm/network_services/tests/api_globalprotect_match_lists_test.py @@ -47,6 +47,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create HTTP Server Profile http_name = f"test-http-{random_id}" http_payload = HttpServerProfiles( + id="", name=http_name, folder=TARGET_FOLDER, server=[HttpServerProfilesServerInner( @@ -63,6 +64,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create Syslog Server Profile (shortened name to stay under 31 char limit) syslog_name = f"sys-{random_id}" syslog_payload = SyslogServerProfiles( + id="", name=syslog_name, folder=TARGET_FOLDER, server=[SyslogServerProfilesServerInner( diff --git a/scm/network_services/tests/api_hipmatch_match_lists_test.py b/scm/network_services/tests/api_hipmatch_match_lists_test.py index 44ff9cfd..3d73a21b 100644 --- a/scm/network_services/tests/api_hipmatch_match_lists_test.py +++ b/scm/network_services/tests/api_hipmatch_match_lists_test.py @@ -47,6 +47,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create HTTP Server Profile http_name = f"test-http-{random_id}" http_payload = HttpServerProfiles( + id="", name=http_name, folder=TARGET_FOLDER, server=[HttpServerProfilesServerInner( @@ -63,6 +64,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create Syslog Server Profile (shortened name to stay under 31 char limit) syslog_name = f"sys-{random_id}" syslog_payload = SyslogServerProfiles( + id="", name=syslog_name, folder=TARGET_FOLDER, server=[SyslogServerProfilesServerInner( diff --git a/scm/network_services/tests/api_iptag_match_lists_test.py b/scm/network_services/tests/api_iptag_match_lists_test.py index ac4d2831..9ebfe42d 100644 --- a/scm/network_services/tests/api_iptag_match_lists_test.py +++ b/scm/network_services/tests/api_iptag_match_lists_test.py @@ -47,6 +47,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create HTTP Server Profile http_name = f"test-http-{random_id}" http_payload = HttpServerProfiles( + id="", name=http_name, folder=TARGET_FOLDER, server=[HttpServerProfilesServerInner( @@ -63,6 +64,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create Syslog Server Profile (shortened name to stay under 31 char limit) syslog_name = f"sys-{random_id}" syslog_payload = SyslogServerProfiles( + id="", name=syslog_name, folder=TARGET_FOLDER, server=[SyslogServerProfilesServerInner( diff --git a/scm/network_services/tests/api_system_match_lists_test.py b/scm/network_services/tests/api_system_match_lists_test.py index 460acfdd..245d2269 100644 --- a/scm/network_services/tests/api_system_match_lists_test.py +++ b/scm/network_services/tests/api_system_match_lists_test.py @@ -47,6 +47,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create HTTP Server Profile http_name = f"test-http-{random_id}" http_payload = HttpServerProfiles( + id="", name=http_name, folder=TARGET_FOLDER, server=[HttpServerProfilesServerInner( @@ -63,6 +64,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create Syslog Server Profile (shortened name to stay under 31 char limit) syslog_name = f"sys-{random_id}" syslog_payload = SyslogServerProfiles( + id="", name=syslog_name, folder=TARGET_FOLDER, server=[SyslogServerProfilesServerInner( diff --git a/scm/network_services/tests/api_userid_match_lists_test.py b/scm/network_services/tests/api_userid_match_lists_test.py index 3c9e7b72..90ea9073 100644 --- a/scm/network_services/tests/api_userid_match_lists_test.py +++ b/scm/network_services/tests/api_userid_match_lists_test.py @@ -47,6 +47,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create HTTP Server Profile http_name = f"test-http-{random_id}" http_payload = HttpServerProfiles( + id="", name=http_name, folder=TARGET_FOLDER, server=[HttpServerProfilesServerInner( @@ -63,6 +64,7 @@ def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): # Create Syslog Server Profile (shortened name to stay under 31 char limit) syslog_name = f"sys-{random_id}" syslog_payload = SyslogServerProfiles( + id="", name=syslog_name, folder=TARGET_FOLDER, server=[SyslogServerProfilesServerInner( diff --git a/scm/objects/tests/api_auto_tag_actions_test.py b/scm/objects/tests/api_auto_tag_actions_test.py index 25f1fd9f..ad29925d 100644 --- a/scm/objects/tests/api_auto_tag_actions_test.py +++ b/scm/objects/tests/api_auto_tag_actions_test.py @@ -17,7 +17,7 @@ def client(): @pytest.fixture(scope="module") def auto_tag_actions_api(client): - return client.objects.AutoTagActionsApi(client.objects.api_client) + return client.security_services.AutoTagActionsApi(client.security_services.api_client) def test_list_auto_tag_actions(auto_tag_actions_api): From 9e8aaca189d03cc6962bc677d626fc2feecf85a4 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Fri, 29 May 2026 15:46:04 -0700 Subject: [PATCH 05/13] add mobile agent specs for ci cd --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c12eee4..667ab661 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ jobs: - config_setup - config_operations - device_settings + - mobile_agent steps: - name: Checkout code From 76a07274b5c58b602d1efff1ce1c1eb2699740df Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Thu, 4 Jun 2026 17:17:18 -0700 Subject: [PATCH 06/13] v1.0.11 changes and python release changes --- .github/workflows/release-python-sdk.yml | 35 +++ .github/workflows/test.yml | 1 - LICENSE | 202 ++++++++++++++++++ MANIFEST.in | 3 + README.md | 28 ++- pyproject.toml | 68 ++++-- .../tests/api_config_match_lists_test.py | 87 +------- .../api_globalprotect_match_lists_test.py | 86 +------- .../tests/api_hipmatch_match_lists_test.py | 86 +------- .../tests/api_ipsec_tunnels_test.py | 4 - .../tests/api_iptag_match_lists_test.py | 86 +------- .../tests/api_system_match_lists_test.py | 86 +------- .../tests/api_userid_match_lists_test.py | 86 +------- scm/objects/__init__.py | 6 + scm/objects/api/__init__.py | 1 + .../api/auto_tag_actions_api.py | 14 +- .../docs/AutoTagActions.md | 2 +- .../docs/AutoTagActionsActionsInner.md | 2 +- .../docs/AutoTagActionsActionsInnerType.md | 2 +- .../AutoTagActionsActionsInnerTypeTagging.md | 2 +- .../docs/AutoTagActionsApi.md | 78 +++---- .../docs/AutoTagActionsListResponse.md | 2 +- scm/objects/models/__init__.py | 5 + .../models/auto_tag_actions.py | 6 +- .../models/auto_tag_actions_actions_inner.py | 6 +- .../auto_tag_actions_actions_inner_type.py | 6 +- ..._tag_actions_actions_inner_type_tagging.py | 4 +- .../models/auto_tag_actions_list_response.py | 6 +- .../tests/api_auto_tag_actions_test.py | 2 +- scm/security_services/__init__.py | 6 - scm/security_services/api/__init__.py | 1 - .../docs/DosProtectionProfilesFloodIcmpRed.md | 6 +- ...ProtectionProfilesFloodTcpSynSynCookies.md | 6 +- scm/security_services/models/__init__.py | 5 - .../dos_protection_profiles_flood_icmp_red.py | 6 +- ...tion_profiles_flood_tcp_syn_syn_cookies.py | 6 +- 36 files changed, 450 insertions(+), 588 deletions(-) create mode 100644 .github/workflows/release-python-sdk.yml create mode 100644 LICENSE create mode 100644 MANIFEST.in rename scm/{security_services => objects}/api/auto_tag_actions_api.py (98%) rename scm/{security_services => objects}/docs/AutoTagActions.md (95%) rename scm/{security_services => objects}/docs/AutoTagActionsActionsInner.md (91%) rename scm/{security_services => objects}/docs/AutoTagActionsActionsInnerType.md (90%) rename scm/{security_services => objects}/docs/AutoTagActionsActionsInnerTypeTagging.md (91%) rename scm/{security_services => objects}/docs/AutoTagActionsApi.md (80%) rename scm/{security_services => objects}/docs/AutoTagActionsListResponse.md (92%) rename scm/{security_services => objects}/models/auto_tag_actions.py (95%) rename scm/{security_services => objects}/models/auto_tag_actions_actions_inner.py (91%) rename scm/{security_services => objects}/models/auto_tag_actions_actions_inner_type.py (91%) rename scm/{security_services => objects}/models/auto_tag_actions_actions_inner_type_tagging.py (96%) rename scm/{security_services => objects}/models/auto_tag_actions_list_response.py (94%) diff --git a/.github/workflows/release-python-sdk.yml b/.github/workflows/release-python-sdk.yml new file mode 100644 index 00000000..131abf68 --- /dev/null +++ b/.github/workflows/release-python-sdk.yml @@ -0,0 +1,35 @@ +# Terraform Provider release workflow. +name: Release-Python-SDK + +# This GitHub action creates a release when a tag that matches the pattern +# "v*" (e.g. v0.1.0) is created. +on: + push: + tags: + - 'v*' + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Build + run: | + pip install build twine + python -m build + + - name: Check Distribution + run: twine check dist/* + + - name: Upload to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: twine upload dist/* \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 667ab661..4c12eee4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,6 @@ jobs: - config_setup - config_operations - device_settings - - mobile_agent steps: - name: Checkout code diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..40d843f1 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include CHANGELOG.md +include LICENSE +include README.md \ No newline at end of file diff --git a/README.md b/README.md index 5a577ba7..a06c382f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ # SCM Python SDK -Auto-generated SDK for Palo Alto Networks Strata Cloud Manager. +[![PyPI version](https://img.shields.io/pypi/v/scm-python.svg)](https://pypi.org/project/scm-python/) [![Python versions](https://img.shields.io/pypi/pyversions/scm-python.svg)](https://pypi.org/project/scm-python/) [![License](https://img.shields.io/pypi/l/scm-python.svg)](https://github.com/PaloAltoNetworks/scm-python/blob/main/LICENSE) -NOTE: This SDK code is auto-generated. +Auto-generated Python SDK for [Palo Alto Networks Strata Cloud Manager (SCM)](https://www.paloaltonetworks.com/strata-cloud-manager). ---- ## Beta Release Disclaimer **This software is a pre-release version and is not ready for production use.** @@ -23,8 +22,23 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI THIS SOFTWARE IS RELEASED AS A PROOF OF CONCEPT FOR EXPERIMENTAL PURPOSES ONLY. USE IT AT OWN RISK. THIS SOFTWARE IS NOT SUPPORTED. +## Table of contents + +- [Installation](#installation) +- [Using scm-python](#using-scm-python) +- [Configuration File](#configuration-file) +- [Basic Usage Example](#basic-usage-example) + ## Installation +Install the released version from PyPI: + +```bash +pip install scm-python +``` + +Install from source (latest `main`): + ```bash pip install git+https://github.com/PaloAltoNetworks/scm-python.git ``` @@ -32,7 +46,7 @@ pip install git+https://github.com/PaloAltoNetworks/scm-python.git For local development (after cloning): ```bash -pip install -e . +pip install -e ".[dev]" ``` ## Using scm-python @@ -172,7 +186,7 @@ This matches the scm-go SDK behavior and provides maximum flexibility. cache.set("jwt_expires_at", client._token_expires_at.isoformat()) cache.set("jwt_lifetime", client._jwt_lifetime) time.sleep(300) - + # Worker processes use cached token worker_client = Scm( client_id="YOUR_ID", @@ -198,7 +212,7 @@ This matches the scm-go SDK behavior and provides maximum flexibility. jwt_lifetime=int(os.environ["JWT_LIFETIME"]) ) # ✅ Fast startup - no auth API call - + addresses_api = client.objects.AddressesApi(client.objects.api_client) addresses = addresses_api.list_addresses(folder="Texas") return addresses @@ -210,7 +224,7 @@ This matches the scm-go SDK behavior and provides maximum flexibility. def test_api_call(): mock_jwt = "test_token_12345" mock_expires = "2099-12-31T23:59:59Z" - + client = Scm( client_id="test", client_secret="test", diff --git a/pyproject.toml b/pyproject.toml index 2f5560c7..56ad1fe9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,38 +5,68 @@ build-backend = "setuptools.build_meta" [project] name = "scm-python" version = "0.1.0" -description = "Palo Alto Networks SCM Python SDK" +description = "Palo Alto Networks Strata Cloud Manager (SCM) Python SDK" authors = [ - { name="Palo Alto Networks", email="devrel@paloaltonetworks.com" }, + { name = "Palo Alto Networks", email = "devrel@paloaltonetworks.com" }, ] readme = "README.md" requires-python = ">=3.10" +license = "Apache-2.0" +license-files = ["LICENSE"] +keywords = [ + "palo-alto-networks", + "scm", + "strata-cloud-manager", + "sase", + "prisma-access", + "sdk", + "security", +] classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Security", + "Topic :: System :: Networking", + "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ - "urllib3 >= 1.25.3, < 2.1.0", - "python-dateutil", - "pydantic >= 2.0.0", - "typing-extensions", - "oauthlib >= 3.3.0", - "requests-oauthlib >= 2.0.0", + "urllib3 >= 1.25.3, < 2.1.0", + "python-dateutil", + "pydantic >= 2.0.0", + "typing-extensions", + "oauthlib >= 3.3.0", + "requests-oauthlib >= 2.0.0", ] -# Define optional dependencies for developers +[project.urls] +Homepage = "https://github.com/PaloAltoNetworks/scm-python" +Documentation = "https://github.com/PaloAltoNetworks/scm-python#readme" +Repository = "https://github.com/PaloAltoNetworks/scm-python" +Issues = "https://github.com/PaloAltoNetworks/scm-python/issues" +Changelog = "https://github.com/PaloAltoNetworks/scm-python/blob/main/CHANGELOG.md" + [project.optional-dependencies] dev = [ - "pytest >= 7.0", - "ruff >= 0.1.0", - "mypy >= 1.0", + "pytest >= 7.0", + "ruff >= 0.1.0", + "mypy >= 1.0", + "packaging >= 23.0", + "build >= 1.0", + "twine >= 5.0", ] -# Configure Ruff (Linter) [tool.ruff] line-length = 100 target-version = "py310" +extend-exclude = ["scm"] # auto-generated SDK code; not lint-clean by design +force-exclude = true # honor extend-exclude even when paths are passed explicitly [tool.ruff.lint] select = ["E", "F", "D"] @@ -45,12 +75,16 @@ ignore = ["E501", "D203", "D213"] [tool.ruff.lint.pydocstyle] convention = "google" +[tool.ruff.lint.per-file-ignores] +"tests/**" = ["D100", "D101", "D103", "D104"] # docstrings in tests are noise +"scripts/__init__.py" = ["D104"] + [tool.setuptools.packages.find] where = ["."] include = ["scm*"] [tool.pytest.ini_options] -testpaths = ["scm"] +testpaths = ["scm", "tests"] python_files = ["test_*.py", "*_test.py"] python_functions = ["test_*"] log_cli = true diff --git a/scm/network_services/tests/api_config_match_lists_test.py b/scm/network_services/tests/api_config_match_lists_test.py index 8d3985f4..4a05c924 100644 --- a/scm/network_services/tests/api_config_match_lists_test.py +++ b/scm/network_services/tests/api_config_match_lists_test.py @@ -4,8 +4,6 @@ import pytest from scm import Scm from scm.network_services.models.config_match_list import ConfigMatchList -from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner -from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -27,79 +25,8 @@ def config_match_list_api(client): return client.network_services.ConfigMatchListApi(client.network_services.api_client) -@pytest.fixture(scope="module") -def http_server_profiles_api(client): - return client.objects.HTTPServerProfilesApi(client.objects.api_client) - - -@pytest.fixture(scope="module") -def syslog_server_profiles_api(client): - return client.objects.SyslogServerProfilesApi(client.objects.api_client) - - -@pytest.fixture -def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): - """ - Creates HTTP and Syslog server profiles as dependencies for Config Match List. - """ - random_id = uuid.uuid4().hex[:6] - - # Create HTTP Server Profile - http_name = f"test-http-{random_id}" - http_payload = HttpServerProfiles( - id="", - name=http_name, - folder=TARGET_FOLDER, - server=[HttpServerProfilesServerInner( - name="http-server-1", - address="192.168.1.100", - port=8080, - protocol="HTTP", - http_method="POST" - )] - ) - logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") - http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) - - # Create Syslog Server Profile (shortened name to stay under 31 char limit) - syslog_name = f"sys-{random_id}" - syslog_payload = SyslogServerProfiles( - id="", - name=syslog_name, - folder=TARGET_FOLDER, - server=[SyslogServerProfilesServerInner( - name="syslog-server-1", - server="192.168.1.101", - port=514, - format="BSD", - facility="LOG_USER", - transport="UDP" - )] - ) - logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") - syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) - - yield { - "http_name": http_name, - "http_id": http_obj.id, - "syslog_name": syslog_name, - "syslog_id": syslog_obj.id - } - - # Cleanup - logger.info(f"\n[TEARDOWN] Deleting dependency profiles") - try: - http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) - except Exception as e: - logger.info(f"Failed to delete HTTP profile: {e}") - try: - syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) - except Exception as e: - logger.info(f"Failed to delete Syslog profile: {e}") - - @pytest.fixture -def clean_config_match_list(config_match_list_api, dependency_profiles): +def clean_config_match_list(config_match_list_api): """ Fixture to create a temporary config match list for testing and automatically delete it after. """ @@ -111,8 +38,10 @@ def clean_config_match_list(config_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], - send_http=[dependency_profiles["http_name"]], + send_syslog=["test-syslog"], + send_http=["some-http-profile"], + send_snmptrap=["snmp_test"], + send_email=["test-email"], send_to_panorama=False ) @@ -137,7 +66,7 @@ def clean_config_match_list(config_match_list_api, dependency_profiles): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_config_match_list(config_match_list_api, dependency_profiles): +def test_create_config_match_list(config_match_list_api): """ Test manual creation and deletion of a config match list. """ @@ -148,7 +77,7 @@ def test_create_config_match_list(config_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Test config match list for create API testing", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], + send_syslog=["test-syslog"], send_to_panorama=False ) @@ -238,7 +167,7 @@ def test_fetch_config_match_list(config_match_list_api, clean_config_match_list) logger.info(f"\n[SUCCESS] fetch_config_match_list correctly returned None for non-existent object") -def test_delete_config_match_list_by_id(config_match_list_api, dependency_profiles): +def test_delete_config_match_list_by_id(config_match_list_api): """ Test deletion specifically. """ diff --git a/scm/network_services/tests/api_globalprotect_match_lists_test.py b/scm/network_services/tests/api_globalprotect_match_lists_test.py index e6ebeb8f..deee08fb 100644 --- a/scm/network_services/tests/api_globalprotect_match_lists_test.py +++ b/scm/network_services/tests/api_globalprotect_match_lists_test.py @@ -4,8 +4,6 @@ import pytest from scm import Scm from scm.network_services.models.globalprotect_match_list import GlobalprotectMatchList -from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner -from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -27,79 +25,8 @@ def globalprotect_match_list_api(client): return client.network_services.GlobalprotectMatchListApi(client.network_services.api_client) -@pytest.fixture(scope="module") -def http_server_profiles_api(client): - return client.objects.HTTPServerProfilesApi(client.objects.api_client) - - -@pytest.fixture(scope="module") -def syslog_server_profiles_api(client): - return client.objects.SyslogServerProfilesApi(client.objects.api_client) - - -@pytest.fixture -def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): - """ - Creates HTTP and Syslog server profiles as dependencies for GlobalProtect Match List. - """ - random_id = uuid.uuid4().hex[:6] - - # Create HTTP Server Profile - http_name = f"test-http-{random_id}" - http_payload = HttpServerProfiles( - id="", - name=http_name, - folder=TARGET_FOLDER, - server=[HttpServerProfilesServerInner( - name="http-server-1", - address="192.168.1.100", - port=8080, - protocol="HTTP", - http_method="POST" - )] - ) - logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") - http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) - - # Create Syslog Server Profile (shortened name to stay under 31 char limit) - syslog_name = f"sys-{random_id}" - syslog_payload = SyslogServerProfiles( - id="", - name=syslog_name, - folder=TARGET_FOLDER, - server=[SyslogServerProfilesServerInner( - name="syslog-server-1", - server="192.168.1.101", - port=514, - format="BSD", - facility="LOG_USER", - transport="UDP" - )] - ) - logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") - syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) - - yield { - "http_name": http_name, - "http_id": http_obj.id, - "syslog_name": syslog_name, - "syslog_id": syslog_obj.id - } - - # Cleanup - logger.info(f"\n[TEARDOWN] Deleting dependency profiles") - try: - http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) - except Exception as e: - logger.info(f"Failed to delete HTTP profile: {e}") - try: - syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) - except Exception as e: - logger.info(f"Failed to delete Syslog profile: {e}") - - @pytest.fixture -def clean_globalprotect_match_list(globalprotect_match_list_api, dependency_profiles): +def clean_globalprotect_match_list(globalprotect_match_list_api): """ Fixture to create a temporary globalprotect match list for testing and automatically delete it after. """ @@ -111,8 +38,11 @@ def clean_globalprotect_match_list(globalprotect_match_list_api, dependency_prof folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], - send_http=[dependency_profiles["http_name"]], + send_syslog=["test-syslog"], + send_http=["some-http-profile"], + send_snmptrap=["snmp_test"], + send_email=["test-email"], + quarantine=False, send_to_panorama=False ) @@ -137,7 +67,7 @@ def clean_globalprotect_match_list(globalprotect_match_list_api, dependency_prof logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_globalprotect_match_list(globalprotect_match_list_api, dependency_profiles): +def test_create_globalprotect_match_list(globalprotect_match_list_api): """ Test manual creation and deletion of a globalprotect match list. """ @@ -148,7 +78,7 @@ def test_create_globalprotect_match_list(globalprotect_match_list_api, dependenc folder=TARGET_FOLDER, description="Test globalprotect match list for create API testing", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], + send_syslog=["test-syslog"], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_hipmatch_match_lists_test.py b/scm/network_services/tests/api_hipmatch_match_lists_test.py index 3d73a21b..7de89c84 100644 --- a/scm/network_services/tests/api_hipmatch_match_lists_test.py +++ b/scm/network_services/tests/api_hipmatch_match_lists_test.py @@ -4,8 +4,6 @@ import pytest from scm import Scm from scm.network_services.models.hipmatch_match_list import HipmatchMatchList -from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner -from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -27,79 +25,8 @@ def hipmatch_match_list_api(client): return client.network_services.HipmatchMatchListApi(client.network_services.api_client) -@pytest.fixture(scope="module") -def http_server_profiles_api(client): - return client.objects.HTTPServerProfilesApi(client.objects.api_client) - - -@pytest.fixture(scope="module") -def syslog_server_profiles_api(client): - return client.objects.SyslogServerProfilesApi(client.objects.api_client) - - -@pytest.fixture -def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): - """ - Creates HTTP and Syslog server profiles as dependencies for HIP Match List. - """ - random_id = uuid.uuid4().hex[:6] - - # Create HTTP Server Profile - http_name = f"test-http-{random_id}" - http_payload = HttpServerProfiles( - id="", - name=http_name, - folder=TARGET_FOLDER, - server=[HttpServerProfilesServerInner( - name="http-server-1", - address="192.168.1.100", - port=8080, - protocol="HTTP", - http_method="POST" - )] - ) - logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") - http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) - - # Create Syslog Server Profile (shortened name to stay under 31 char limit) - syslog_name = f"sys-{random_id}" - syslog_payload = SyslogServerProfiles( - id="", - name=syslog_name, - folder=TARGET_FOLDER, - server=[SyslogServerProfilesServerInner( - name="syslog-server-1", - server="192.168.1.101", - port=514, - format="BSD", - facility="LOG_USER", - transport="UDP" - )] - ) - logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") - syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) - - yield { - "http_name": http_name, - "http_id": http_obj.id, - "syslog_name": syslog_name, - "syslog_id": syslog_obj.id - } - - # Cleanup - logger.info(f"\n[TEARDOWN] Deleting dependency profiles") - try: - http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) - except Exception as e: - logger.info(f"Failed to delete HTTP profile: {e}") - try: - syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) - except Exception as e: - logger.info(f"Failed to delete Syslog profile: {e}") - - @pytest.fixture -def clean_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): +def clean_hipmatch_match_list(hipmatch_match_list_api): """ Fixture to create a temporary hipmatch match list for testing and automatically delete it after. """ @@ -111,8 +38,11 @@ def clean_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], - send_http=[dependency_profiles["http_name"]], + send_syslog=["test-syslog"], + send_http=["some-http-profile"], + send_snmptrap=["snmp_test"], + send_email=["test-email"], + quarantine=False, send_to_panorama=False ) @@ -137,7 +67,7 @@ def clean_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): +def test_create_hipmatch_match_list(hipmatch_match_list_api): """ Test manual creation and deletion of a hipmatch match list. """ @@ -148,7 +78,7 @@ def test_create_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles folder=TARGET_FOLDER, description="Test hipmatch match list for create API testing", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], + send_syslog=["test-syslog"], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_ipsec_tunnels_test.py b/scm/network_services/tests/api_ipsec_tunnels_test.py index 7eb18f27..d6501648 100644 --- a/scm/network_services/tests/api_ipsec_tunnels_test.py +++ b/scm/network_services/tests/api_ipsec_tunnels_test.py @@ -12,8 +12,6 @@ IkeGatewaysAuthentication, IkeGatewaysAuthenticationPreSharedKey, IkeGatewaysPeerAddress, - IkeGatewaysPeerId, - IkeGatewaysLocalId, IkeGatewaysProtocol, IkeGatewaysProtocolIkev1, IkeCryptoProfiles, @@ -71,8 +69,6 @@ def dependency_ike_gateway(ike_gw_api, ike_crypto_api): pre_shared_key=IkeGatewaysAuthenticationPreSharedKey(key="secret123") ), peer_address=IkeGatewaysPeerAddress(ip="1.1.1.1"), - peer_id=IkeGatewaysPeerId(type="ipaddr", id="10.3.3.4"), - local_id=IkeGatewaysLocalId(type="ipaddr", id="10.3.4.4"), protocol=IkeGatewaysProtocol( ikev1=IkeGatewaysProtocolIkev1(ike_crypto_profile=crypto_name), version="ikev1" diff --git a/scm/network_services/tests/api_iptag_match_lists_test.py b/scm/network_services/tests/api_iptag_match_lists_test.py index 9ebfe42d..37650b17 100644 --- a/scm/network_services/tests/api_iptag_match_lists_test.py +++ b/scm/network_services/tests/api_iptag_match_lists_test.py @@ -4,8 +4,6 @@ import pytest from scm import Scm from scm.network_services.models.iptag_match_list import IptagMatchList -from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner -from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -27,79 +25,8 @@ def iptag_match_list_api(client): return client.network_services.IptagMatchListApi(client.network_services.api_client) -@pytest.fixture(scope="module") -def http_server_profiles_api(client): - return client.objects.HTTPServerProfilesApi(client.objects.api_client) - - -@pytest.fixture(scope="module") -def syslog_server_profiles_api(client): - return client.objects.SyslogServerProfilesApi(client.objects.api_client) - - -@pytest.fixture -def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): - """ - Creates HTTP and Syslog server profiles as dependencies for IP Tag Match List. - """ - random_id = uuid.uuid4().hex[:6] - - # Create HTTP Server Profile - http_name = f"test-http-{random_id}" - http_payload = HttpServerProfiles( - id="", - name=http_name, - folder=TARGET_FOLDER, - server=[HttpServerProfilesServerInner( - name="http-server-1", - address="192.168.1.100", - port=8080, - protocol="HTTP", - http_method="POST" - )] - ) - logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") - http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) - - # Create Syslog Server Profile (shortened name to stay under 31 char limit) - syslog_name = f"sys-{random_id}" - syslog_payload = SyslogServerProfiles( - id="", - name=syslog_name, - folder=TARGET_FOLDER, - server=[SyslogServerProfilesServerInner( - name="syslog-server-1", - server="192.168.1.101", - port=514, - format="BSD", - facility="LOG_USER", - transport="UDP" - )] - ) - logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") - syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) - - yield { - "http_name": http_name, - "http_id": http_obj.id, - "syslog_name": syslog_name, - "syslog_id": syslog_obj.id - } - - # Cleanup - logger.info(f"\n[TEARDOWN] Deleting dependency profiles") - try: - http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) - except Exception as e: - logger.info(f"Failed to delete HTTP profile: {e}") - try: - syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) - except Exception as e: - logger.info(f"Failed to delete Syslog profile: {e}") - - @pytest.fixture -def clean_iptag_match_list(iptag_match_list_api, dependency_profiles): +def clean_iptag_match_list(iptag_match_list_api): """ Fixture to create a temporary iptag match list for testing and automatically delete it after. """ @@ -111,8 +38,11 @@ def clean_iptag_match_list(iptag_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], - send_http=[dependency_profiles["http_name"]], + send_syslog=["test-syslog"], + send_http=["some-http-profile"], + send_snmptrap=["snmp_test"], + send_email=["test-email"], + quarantine=False, send_to_panorama=False ) @@ -137,7 +67,7 @@ def clean_iptag_match_list(iptag_match_list_api, dependency_profiles): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_iptag_match_list(iptag_match_list_api, dependency_profiles): +def test_create_iptag_match_list(iptag_match_list_api): """ Test manual creation and deletion of an iptag match list. """ @@ -148,7 +78,7 @@ def test_create_iptag_match_list(iptag_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Test iptag match list for create API testing", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], + send_syslog=["test-syslog"], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_system_match_lists_test.py b/scm/network_services/tests/api_system_match_lists_test.py index 245d2269..523f862e 100644 --- a/scm/network_services/tests/api_system_match_lists_test.py +++ b/scm/network_services/tests/api_system_match_lists_test.py @@ -4,8 +4,6 @@ import pytest from scm import Scm from scm.network_services.models.system_match_list import SystemMatchList -from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner -from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -27,79 +25,8 @@ def system_match_list_api(client): return client.network_services.SystemMatchListApi(client.network_services.api_client) -@pytest.fixture(scope="module") -def http_server_profiles_api(client): - return client.objects.HTTPServerProfilesApi(client.objects.api_client) - - -@pytest.fixture(scope="module") -def syslog_server_profiles_api(client): - return client.objects.SyslogServerProfilesApi(client.objects.api_client) - - -@pytest.fixture -def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): - """ - Creates HTTP and Syslog server profiles as dependencies for System Match List. - """ - random_id = uuid.uuid4().hex[:6] - - # Create HTTP Server Profile - http_name = f"test-http-{random_id}" - http_payload = HttpServerProfiles( - id="", - name=http_name, - folder=TARGET_FOLDER, - server=[HttpServerProfilesServerInner( - name="http-server-1", - address="192.168.1.100", - port=8080, - protocol="HTTP", - http_method="POST" - )] - ) - logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") - http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) - - # Create Syslog Server Profile (shortened name to stay under 31 char limit) - syslog_name = f"sys-{random_id}" - syslog_payload = SyslogServerProfiles( - id="", - name=syslog_name, - folder=TARGET_FOLDER, - server=[SyslogServerProfilesServerInner( - name="syslog-server-1", - server="192.168.1.101", - port=514, - format="BSD", - facility="LOG_USER", - transport="UDP" - )] - ) - logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") - syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) - - yield { - "http_name": http_name, - "http_id": http_obj.id, - "syslog_name": syslog_name, - "syslog_id": syslog_obj.id - } - - # Cleanup - logger.info(f"\n[TEARDOWN] Deleting dependency profiles") - try: - http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) - except Exception as e: - logger.info(f"Failed to delete HTTP profile: {e}") - try: - syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) - except Exception as e: - logger.info(f"Failed to delete Syslog profile: {e}") - - @pytest.fixture -def clean_system_match_list(system_match_list_api, dependency_profiles): +def clean_system_match_list(system_match_list_api): """ Fixture to create a temporary system match list for testing and automatically delete it after. """ @@ -111,8 +38,11 @@ def clean_system_match_list(system_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], - send_http=[dependency_profiles["http_name"]], + send_syslog=["test-syslog"], + send_http=["some-http-profile"], + send_snmptrap=["snmp_test"], + send_email=["test-email"], + quarantine=False, send_to_panorama=False ) @@ -137,7 +67,7 @@ def clean_system_match_list(system_match_list_api, dependency_profiles): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_system_match_list(system_match_list_api, dependency_profiles): +def test_create_system_match_list(system_match_list_api): """ Test manual creation and deletion of a system match list. """ @@ -148,7 +78,7 @@ def test_create_system_match_list(system_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Test system match list for create API testing", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], + send_syslog=["test-syslog"], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_userid_match_lists_test.py b/scm/network_services/tests/api_userid_match_lists_test.py index 90ea9073..4046b15b 100644 --- a/scm/network_services/tests/api_userid_match_lists_test.py +++ b/scm/network_services/tests/api_userid_match_lists_test.py @@ -4,8 +4,6 @@ import pytest from scm import Scm from scm.network_services.models.userid_match_list import UseridMatchList -from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner -from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -27,79 +25,8 @@ def userid_match_list_api(client): return client.network_services.UseridMatchListApi(client.network_services.api_client) -@pytest.fixture(scope="module") -def http_server_profiles_api(client): - return client.objects.HTTPServerProfilesApi(client.objects.api_client) - - -@pytest.fixture(scope="module") -def syslog_server_profiles_api(client): - return client.objects.SyslogServerProfilesApi(client.objects.api_client) - - -@pytest.fixture -def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): - """ - Creates HTTP and Syslog server profiles as dependencies for User ID Match List. - """ - random_id = uuid.uuid4().hex[:6] - - # Create HTTP Server Profile - http_name = f"test-http-{random_id}" - http_payload = HttpServerProfiles( - id="", - name=http_name, - folder=TARGET_FOLDER, - server=[HttpServerProfilesServerInner( - name="http-server-1", - address="192.168.1.100", - port=8080, - protocol="HTTP", - http_method="POST" - )] - ) - logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") - http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) - - # Create Syslog Server Profile (shortened name to stay under 31 char limit) - syslog_name = f"sys-{random_id}" - syslog_payload = SyslogServerProfiles( - id="", - name=syslog_name, - folder=TARGET_FOLDER, - server=[SyslogServerProfilesServerInner( - name="syslog-server-1", - server="192.168.1.101", - port=514, - format="BSD", - facility="LOG_USER", - transport="UDP" - )] - ) - logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") - syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) - - yield { - "http_name": http_name, - "http_id": http_obj.id, - "syslog_name": syslog_name, - "syslog_id": syslog_obj.id - } - - # Cleanup - logger.info(f"\n[TEARDOWN] Deleting dependency profiles") - try: - http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) - except Exception as e: - logger.info(f"Failed to delete HTTP profile: {e}") - try: - syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) - except Exception as e: - logger.info(f"Failed to delete Syslog profile: {e}") - - @pytest.fixture -def clean_userid_match_list(userid_match_list_api, dependency_profiles): +def clean_userid_match_list(userid_match_list_api): """ Fixture to create a temporary userid match list for testing and automatically delete it after. """ @@ -111,8 +38,11 @@ def clean_userid_match_list(userid_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], - send_http=[dependency_profiles["http_name"]], + send_syslog=["test-syslog"], + send_http=["some-http-profile"], + send_snmptrap=["snmp_test"], + send_email=["test-email"], + quarantine=False, send_to_panorama=False ) @@ -137,7 +67,7 @@ def clean_userid_match_list(userid_match_list_api, dependency_profiles): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_userid_match_list(userid_match_list_api, dependency_profiles): +def test_create_userid_match_list(userid_match_list_api): """ Test manual creation and deletion of a userid match list. """ @@ -148,7 +78,7 @@ def test_create_userid_match_list(userid_match_list_api, dependency_profiles): folder=TARGET_FOLDER, description="Test userid match list for create API testing", filter="All Logs", - send_syslog=[dependency_profiles["syslog_name"]], + send_syslog=["test-syslog"], send_to_panorama=False ) diff --git a/scm/objects/__init__.py b/scm/objects/__init__.py index 39ba59ae..5705afe1 100644 --- a/scm/objects/__init__.py +++ b/scm/objects/__init__.py @@ -23,6 +23,7 @@ from scm.objects.api.application_filters_api import ApplicationFiltersApi from scm.objects.api.application_groups_api import ApplicationGroupsApi from scm.objects.api.applications_api import ApplicationsApi +from scm.objects.api.auto_tag_actions_api import AutoTagActionsApi from scm.objects.api.dynamic_user_groups_api import DynamicUserGroupsApi from scm.objects.api.external_dynamic_lists_api import ExternalDynamicListsApi from scm.objects.api.hip_objects_api import HIPObjectsApi @@ -71,6 +72,11 @@ from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThan from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than_qualifier_inner import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThanQualifierInner from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_pattern_match import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorPatternMatch +from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.objects.models.dynamic_user_groups import DynamicUserGroups from scm.objects.models.dynamic_user_groups_list_response import DynamicUserGroupsListResponse from scm.objects.models.error_detail_cause_info import ErrorDetailCauseInfo diff --git a/scm/objects/api/__init__.py b/scm/objects/api/__init__.py index 6d622512..e4e18ed0 100644 --- a/scm/objects/api/__init__.py +++ b/scm/objects/api/__init__.py @@ -6,6 +6,7 @@ from scm.objects.api.application_filters_api import ApplicationFiltersApi from scm.objects.api.application_groups_api import ApplicationGroupsApi from scm.objects.api.applications_api import ApplicationsApi +from scm.objects.api.auto_tag_actions_api import AutoTagActionsApi from scm.objects.api.dynamic_user_groups_api import DynamicUserGroupsApi from scm.objects.api.external_dynamic_lists_api import ExternalDynamicListsApi from scm.objects.api.hip_objects_api import HIPObjectsApi diff --git a/scm/security_services/api/auto_tag_actions_api.py b/scm/objects/api/auto_tag_actions_api.py similarity index 98% rename from scm/security_services/api/auto_tag_actions_api.py rename to scm/objects/api/auto_tag_actions_api.py index 31f730f1..f3637a35 100644 --- a/scm/security_services/api/auto_tag_actions_api.py +++ b/scm/objects/api/auto_tag_actions_api.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Security Services + Objects - These APIs are used for defining and managing security services configurations within Strata Cloud Manager. + These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,12 +20,12 @@ from pydantic import Field, StrictInt, StrictStr from typing import Optional from typing_extensions import Annotated -from scm.security_services.models.auto_tag_actions import AutoTagActions -from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse -from scm.security_services.api_client import ApiClient, RequestSerialized -from scm.security_services.api_response import ApiResponse -from scm.security_services.rest import RESTResponseType +from scm.objects.api_client import ApiClient, RequestSerialized +from scm.objects.api_response import ApiResponse +from scm.objects.rest import RESTResponseType from scm.decorators import with_error_handling diff --git a/scm/security_services/docs/AutoTagActions.md b/scm/objects/docs/AutoTagActions.md similarity index 95% rename from scm/security_services/docs/AutoTagActions.md rename to scm/objects/docs/AutoTagActions.md index 2dbd2a41..9cd21935 100644 --- a/scm/security_services/docs/AutoTagActions.md +++ b/scm/objects/docs/AutoTagActions.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.objects.models.auto_tag_actions import AutoTagActions # TODO update the JSON string below json = "{}" diff --git a/scm/security_services/docs/AutoTagActionsActionsInner.md b/scm/objects/docs/AutoTagActionsActionsInner.md similarity index 91% rename from scm/security_services/docs/AutoTagActionsActionsInner.md rename to scm/objects/docs/AutoTagActionsActionsInner.md index f26577f7..5758581c 100644 --- a/scm/security_services/docs/AutoTagActionsActionsInner.md +++ b/scm/objects/docs/AutoTagActionsActionsInner.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner # TODO update the JSON string below json = "{}" diff --git a/scm/security_services/docs/AutoTagActionsActionsInnerType.md b/scm/objects/docs/AutoTagActionsActionsInnerType.md similarity index 90% rename from scm/security_services/docs/AutoTagActionsActionsInnerType.md rename to scm/objects/docs/AutoTagActionsActionsInnerType.md index f04a5fed..3ed205e2 100644 --- a/scm/security_services/docs/AutoTagActionsActionsInnerType.md +++ b/scm/objects/docs/AutoTagActionsActionsInnerType.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType # TODO update the JSON string below json = "{}" diff --git a/scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md b/scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md similarity index 91% rename from scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md rename to scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md index 71335cda..65b6e013 100644 --- a/scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md +++ b/scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging # TODO update the JSON string below json = "{}" diff --git a/scm/security_services/docs/AutoTagActionsApi.md b/scm/objects/docs/AutoTagActionsApi.md similarity index 80% rename from scm/security_services/docs/AutoTagActionsApi.md rename to scm/objects/docs/AutoTagActionsApi.md index 233f7575..fb2243d5 100644 --- a/scm/security_services/docs/AutoTagActionsApi.md +++ b/scm/objects/docs/AutoTagActionsApi.md @@ -1,6 +1,6 @@ -# scm.security_services.AutoTagActionsApi +# scm.objects.AutoTagActionsApi -All URIs are relative to *https://api.strata.paloaltonetworks.com/config/security/v1* +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/objects/v1* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -22,15 +22,15 @@ Create a new auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.security_services -from scm.security_services.models.auto_tag_actions import AutoTagActions -from scm.security_services.rest import ApiException +import scm.objects +from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.objects.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.security_services.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/security/v1" +configuration = scm.objects.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/objects/v1" ) # The client must configure the authentication and authorization parameters @@ -39,15 +39,15 @@ configuration = scm.security_services.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.security_services.Configuration( +configuration = scm.objects.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.security_services.ApiClient(configuration) as api_client: +with scm.objects.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.security_services.AutoTagActionsApi(api_client) - auto_tag_actions = scm.security_services.AutoTagActions() # AutoTagActions | Created (optional) + api_instance = scm.objects.AutoTagActionsApi(api_client) + auto_tag_actions = scm.objects.AutoTagActions() # AutoTagActions | Created (optional) try: # Create an auto-tag action @@ -105,14 +105,14 @@ Delete an auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.security_services -from scm.security_services.rest import ApiException +import scm.objects +from scm.objects.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.security_services.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/security/v1" +configuration = scm.objects.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/objects/v1" ) # The client must configure the authentication and authorization parameters @@ -121,14 +121,14 @@ configuration = scm.security_services.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.security_services.Configuration( +configuration = scm.objects.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.security_services.ApiClient(configuration) as api_client: +with scm.objects.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.security_services.AutoTagActionsApi(api_client) + api_instance = scm.objects.AutoTagActionsApi(api_client) name = 'name_example' # str | The name of the configuration resource try: @@ -186,15 +186,15 @@ Retrieve a list of auto-tag actions * Bearer (JWT) Authentication (scmToken): ```python -import scm.security_services -from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse -from scm.security_services.rest import ApiException +import scm.objects +from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.objects.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.security_services.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/security/v1" +configuration = scm.objects.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/objects/v1" ) # The client must configure the authentication and authorization parameters @@ -203,14 +203,14 @@ configuration = scm.security_services.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.security_services.Configuration( +configuration = scm.objects.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.security_services.ApiClient(configuration) as api_client: +with scm.objects.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.security_services.AutoTagActionsApi(api_client) + api_instance = scm.objects.AutoTagActionsApi(api_client) name = 'name_example' # str | The name of the configuration resource (optional) offset = 0 # int | The offset into the list of results returned (optional) (default to 0) limit = 200 # int | The maximum number of results per page (optional) (default to 200) @@ -273,15 +273,15 @@ Update an existing auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.security_services -from scm.security_services.models.auto_tag_actions import AutoTagActions -from scm.security_services.rest import ApiException +import scm.objects +from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.objects.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.security_services.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/security/v1" +configuration = scm.objects.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/objects/v1" ) # The client must configure the authentication and authorization parameters @@ -290,15 +290,15 @@ configuration = scm.security_services.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.security_services.Configuration( +configuration = scm.objects.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.security_services.ApiClient(configuration) as api_client: +with scm.objects.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.security_services.AutoTagActionsApi(api_client) - auto_tag_actions = scm.security_services.AutoTagActions() # AutoTagActions | OK (optional) + api_instance = scm.objects.AutoTagActionsApi(api_client) + auto_tag_actions = scm.objects.AutoTagActions() # AutoTagActions | OK (optional) try: # Update an auto-tag action diff --git a/scm/security_services/docs/AutoTagActionsListResponse.md b/scm/objects/docs/AutoTagActionsListResponse.md similarity index 92% rename from scm/security_services/docs/AutoTagActionsListResponse.md rename to scm/objects/docs/AutoTagActionsListResponse.md index 087a90cf..5712e845 100644 --- a/scm/security_services/docs/AutoTagActionsListResponse.md +++ b/scm/objects/docs/AutoTagActionsListResponse.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse # TODO update the JSON string below json = "{}" diff --git a/scm/objects/models/__init__.py b/scm/objects/models/__init__.py index 0e9163d8..fd0e820e 100644 --- a/scm/objects/models/__init__.py +++ b/scm/objects/models/__init__.py @@ -37,6 +37,11 @@ from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThan from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than_qualifier_inner import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThanQualifierInner from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_pattern_match import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorPatternMatch +from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.objects.models.dynamic_user_groups import DynamicUserGroups from scm.objects.models.dynamic_user_groups_list_response import DynamicUserGroupsListResponse from scm.objects.models.error_detail_cause_info import ErrorDetailCauseInfo diff --git a/scm/security_services/models/auto_tag_actions.py b/scm/objects/models/auto_tag_actions.py similarity index 95% rename from scm/security_services/models/auto_tag_actions.py rename to scm/objects/models/auto_tag_actions.py index d3ced581..9877b9fe 100644 --- a/scm/security_services/models/auto_tag_actions.py +++ b/scm/objects/models/auto_tag_actions.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Security Services + Objects - These APIs are used for defining and managing security services configurations within Strata Cloud Manager. + These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner from typing import Optional, Set from typing_extensions import Self diff --git a/scm/security_services/models/auto_tag_actions_actions_inner.py b/scm/objects/models/auto_tag_actions_actions_inner.py similarity index 91% rename from scm/security_services/models/auto_tag_actions_actions_inner.py rename to scm/objects/models/auto_tag_actions_actions_inner.py index dc2e6c84..359782f8 100644 --- a/scm/security_services/models/auto_tag_actions_actions_inner.py +++ b/scm/objects/models/auto_tag_actions_actions_inner.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Security Services + Objects - These APIs are used for defining and managing security services configurations within Strata Cloud Manager. + These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType from typing import Optional, Set from typing_extensions import Self diff --git a/scm/security_services/models/auto_tag_actions_actions_inner_type.py b/scm/objects/models/auto_tag_actions_actions_inner_type.py similarity index 91% rename from scm/security_services/models/auto_tag_actions_actions_inner_type.py rename to scm/objects/models/auto_tag_actions_actions_inner_type.py index 74a6f828..ce63a501 100644 --- a/scm/security_services/models/auto_tag_actions_actions_inner_type.py +++ b/scm/objects/models/auto_tag_actions_actions_inner_type.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Security Services + Objects - These APIs are used for defining and managing security services configurations within Strata Cloud Manager. + These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging from typing import Optional, Set from typing_extensions import Self diff --git a/scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py b/scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py similarity index 96% rename from scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py rename to scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py index 4f5386ee..f28d1c1d 100644 --- a/scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py +++ b/scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Security Services + Objects - These APIs are used for defining and managing security services configurations within Strata Cloud Manager. + These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com diff --git a/scm/security_services/models/auto_tag_actions_list_response.py b/scm/objects/models/auto_tag_actions_list_response.py similarity index 94% rename from scm/security_services/models/auto_tag_actions_list_response.py rename to scm/objects/models/auto_tag_actions_list_response.py index 75c1ae6d..126c221e 100644 --- a/scm/security_services/models/auto_tag_actions_list_response.py +++ b/scm/objects/models/auto_tag_actions_list_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Security Services + Objects - These APIs are used for defining and managing security services configurations within Strata Cloud Manager. + These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List -from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.objects.models.auto_tag_actions import AutoTagActions from typing import Optional, Set from typing_extensions import Self diff --git a/scm/objects/tests/api_auto_tag_actions_test.py b/scm/objects/tests/api_auto_tag_actions_test.py index ad29925d..25f1fd9f 100644 --- a/scm/objects/tests/api_auto_tag_actions_test.py +++ b/scm/objects/tests/api_auto_tag_actions_test.py @@ -17,7 +17,7 @@ def client(): @pytest.fixture(scope="module") def auto_tag_actions_api(client): - return client.security_services.AutoTagActionsApi(client.security_services.api_client) + return client.objects.AutoTagActionsApi(client.objects.api_client) def test_list_auto_tag_actions(auto_tag_actions_api): diff --git a/scm/security_services/__init__.py b/scm/security_services/__init__.py index f0211513..e0370840 100644 --- a/scm/security_services/__init__.py +++ b/scm/security_services/__init__.py @@ -21,7 +21,6 @@ from scm.security_services.api.anti_spyware_profiles_api import AntiSpywareProfilesApi from scm.security_services.api.anti_spyware_signatures_api import AntiSpywareSignaturesApi from scm.security_services.api.application_override_rules_api import ApplicationOverrideRulesApi -from scm.security_services.api.auto_tag_actions_api import AutoTagActionsApi from scm.security_services.api.dns_security_profiles_api import DNSSecurityProfilesApi from scm.security_services.api.data_filtering_api import DataFilteringApi from scm.security_services.api.data_objects_api import DataObjectsApi @@ -84,11 +83,6 @@ from scm.security_services.models.anti_spyware_signatures_signature_standard_inner_and_condition_inner_or_condition_inner_operator_pattern_match import AntiSpywareSignaturesSignatureStandardInnerAndConditionInnerOrConditionInnerOperatorPatternMatch from scm.security_services.models.app_override_rules import AppOverrideRules from scm.security_services.models.application_override_rules_list_response import ApplicationOverrideRulesListResponse -from scm.security_services.models.auto_tag_actions import AutoTagActions -from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner -from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType -from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging -from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.security_services.models.base_rule_properties import BaseRuleProperties from scm.security_services.models.dns_security_profiles_list_response import DNSSecurityProfilesListResponse from scm.security_services.models.data_filtering_profiles import DataFilteringProfiles diff --git a/scm/security_services/api/__init__.py b/scm/security_services/api/__init__.py index 3637b815..65c8fe5f 100644 --- a/scm/security_services/api/__init__.py +++ b/scm/security_services/api/__init__.py @@ -4,7 +4,6 @@ from scm.security_services.api.anti_spyware_profiles_api import AntiSpywareProfilesApi from scm.security_services.api.anti_spyware_signatures_api import AntiSpywareSignaturesApi from scm.security_services.api.application_override_rules_api import ApplicationOverrideRulesApi -from scm.security_services.api.auto_tag_actions_api import AutoTagActionsApi from scm.security_services.api.dns_security_profiles_api import DNSSecurityProfilesApi from scm.security_services.api.data_filtering_api import DataFilteringApi from scm.security_services.api.data_objects_api import DataObjectsApi diff --git a/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md b/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md index ba0496d4..c2a0ce79 100644 --- a/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md +++ b/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activate_rate** | **int** | Connection rate (cps) to start RED | [optional] [default to 10000] -**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [optional] [default to 10000] +**activate_rate** | **int** | Connection rate (cps) to start RED | [default to 10000] +**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [default to 10000] **block** | [**DosProtectionProfilesFloodIcmpRedBlock**](DosProtectionProfilesFloodIcmpRedBlock.md) | | [optional] -**maximal_rate** | **int** | Maximal connection rate (cps) allowed | [optional] [default to 40000] +**maximal_rate** | **int** | Maximal connection rate (cps) allowed | [default to 40000] ## Example diff --git a/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md b/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md index 207e61a4..a680ace9 100644 --- a/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md +++ b/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activate_rate** | **int** | Connection rate (cps) to activate SYN cookies proxy | [optional] [default to 0] -**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [optional] [default to 10000] +**activate_rate** | **int** | Connection rate (cps) to activate SYN cookies proxy | [default to 0] +**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [default to 10000] **block** | [**DosProtectionProfilesFloodTcpSynSynCookiesBlock**](DosProtectionProfilesFloodTcpSynSynCookiesBlock.md) | | [optional] -**maximal_rate** | **int** | Maximum connection rate (cps) allowed | [optional] [default to 1000000] +**maximal_rate** | **int** | Maximum connection rate (cps) allowed | [default to 1000000] ## Example diff --git a/scm/security_services/models/__init__.py b/scm/security_services/models/__init__.py index 202c93f3..4dba277a 100644 --- a/scm/security_services/models/__init__.py +++ b/scm/security_services/models/__init__.py @@ -44,11 +44,6 @@ from scm.security_services.models.anti_spyware_signatures_signature_standard_inner_and_condition_inner_or_condition_inner_operator_pattern_match import AntiSpywareSignaturesSignatureStandardInnerAndConditionInnerOrConditionInnerOperatorPatternMatch from scm.security_services.models.app_override_rules import AppOverrideRules from scm.security_services.models.application_override_rules_list_response import ApplicationOverrideRulesListResponse -from scm.security_services.models.auto_tag_actions import AutoTagActions -from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner -from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType -from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging -from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.security_services.models.base_rule_properties import BaseRuleProperties from scm.security_services.models.dns_security_profiles_list_response import DNSSecurityProfilesListResponse from scm.security_services.models.data_filtering_profiles import DataFilteringProfiles diff --git a/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py b/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py index b00b01be..1ec8e9cf 100644 --- a/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py +++ b/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py @@ -29,10 +29,10 @@ class DosProtectionProfilesFloodIcmpRed(BaseModel): """ DosProtectionProfilesFloodIcmpRed """ # noqa: E501 - activate_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=10000, description="Connection rate (cps) to start RED", alias="activate-rate") - alarm_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=10000, description="Connection rate (cps) to generate alarm", alias="alarm-rate") + activate_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Connection rate (cps) to start RED", alias="activate-rate") + alarm_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to generate alarm", alias="alarm-rate") block: Optional[DosProtectionProfilesFloodIcmpRedBlock] = None - maximal_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=40000, description="Maximal connection rate (cps) allowed", alias="maximal-rate") + maximal_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Maximal connection rate (cps) allowed", alias="maximal-rate") __properties: ClassVar[List[str]] = ["activate-rate", "alarm-rate", "block", "maximal-rate"] model_config = ConfigDict( diff --git a/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py b/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py index 4d1cf2b8..6c96babf 100644 --- a/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py +++ b/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py @@ -29,10 +29,10 @@ class DosProtectionProfilesFloodTcpSynSynCookies(BaseModel): """ DosProtectionProfilesFloodTcpSynSynCookies """ # noqa: E501 - activate_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=0, description="Connection rate (cps) to activate SYN cookies proxy", alias="activate-rate") - alarm_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=10000, description="Connection rate (cps) to generate alarm", alias="alarm-rate") + activate_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to activate SYN cookies proxy", alias="activate-rate") + alarm_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to generate alarm", alias="alarm-rate") block: Optional[DosProtectionProfilesFloodTcpSynSynCookiesBlock] = None - maximal_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=1000000, description="Maximum connection rate (cps) allowed", alias="maximal-rate") + maximal_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Maximum connection rate (cps) allowed", alias="maximal-rate") __properties: ClassVar[List[str]] = ["activate-rate", "alarm-rate", "block", "maximal-rate"] model_config = ConfigDict( From 4cd90c186da302cea603fc4a2f5305630fc5eda7 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Thu, 4 Jun 2026 17:33:29 -0700 Subject: [PATCH 07/13] updated pyproject version to 0.0.1-beta.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 56ad1fe9..96bee611 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "scm-python" -version = "0.1.0" +version = "0.0.1-beta.2" description = "Palo Alto Networks Strata Cloud Manager (SCM) Python SDK" authors = [ { name = "Palo Alto Networks", email = "devrel@paloaltonetworks.com" }, From 0f372889fd16eae459acb09ac2afa67bfb0cbba5 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Fri, 5 Jun 2026 15:37:33 -0700 Subject: [PATCH 08/13] v0.0.1-beta.1 changes --- .github/workflows/release-python-sdk.yml | 217 +++++++++++++++--- .github/workflows/test.yml | 1 + CHANGELOG.md | 7 + README.md | 4 +- pyproject.toml | 4 +- .../tests/api_config_match_lists_test.py | 87 ++++++- .../api_globalprotect_match_lists_test.py | 86 ++++++- .../tests/api_hipmatch_match_lists_test.py | 86 ++++++- .../tests/api_ipsec_tunnels_test.py | 4 + .../tests/api_iptag_match_lists_test.py | 86 ++++++- .../tests/api_system_match_lists_test.py | 86 ++++++- .../tests/api_userid_match_lists_test.py | 86 ++++++- scm/objects/__init__.py | 6 - scm/objects/api/__init__.py | 1 - scm/objects/models/__init__.py | 5 - .../tests/api_auto_tag_actions_test.py | 2 +- scm/security_services/__init__.py | 6 + scm/security_services/api/__init__.py | 1 + .../api/auto_tag_actions_api.py | 14 +- .../docs/AutoTagActions.md | 2 +- .../docs/AutoTagActionsActionsInner.md | 2 +- .../docs/AutoTagActionsActionsInnerType.md | 2 +- .../AutoTagActionsActionsInnerTypeTagging.md | 2 +- .../docs/AutoTagActionsApi.md | 78 +++---- .../docs/AutoTagActionsListResponse.md | 2 +- .../docs/DosProtectionProfilesFloodIcmpRed.md | 6 +- ...ProtectionProfilesFloodTcpSynSynCookies.md | 6 +- scm/security_services/models/__init__.py | 5 + .../models/auto_tag_actions.py | 6 +- .../models/auto_tag_actions_actions_inner.py | 6 +- .../auto_tag_actions_actions_inner_type.py | 6 +- ..._tag_actions_actions_inner_type_tagging.py | 4 +- .../models/auto_tag_actions_list_response.py | 6 +- .../dos_protection_profiles_flood_icmp_red.py | 6 +- ...tion_profiles_flood_tcp_syn_syn_cookies.py | 6 +- 35 files changed, 765 insertions(+), 169 deletions(-) create mode 100644 CHANGELOG.md rename scm/{objects => security_services}/api/auto_tag_actions_api.py (98%) rename scm/{objects => security_services}/docs/AutoTagActions.md (95%) rename scm/{objects => security_services}/docs/AutoTagActionsActionsInner.md (91%) rename scm/{objects => security_services}/docs/AutoTagActionsActionsInnerType.md (90%) rename scm/{objects => security_services}/docs/AutoTagActionsActionsInnerTypeTagging.md (91%) rename scm/{objects => security_services}/docs/AutoTagActionsApi.md (80%) rename scm/{objects => security_services}/docs/AutoTagActionsListResponse.md (92%) rename scm/{objects => security_services}/models/auto_tag_actions.py (95%) rename scm/{objects => security_services}/models/auto_tag_actions_actions_inner.py (91%) rename scm/{objects => security_services}/models/auto_tag_actions_actions_inner_type.py (91%) rename scm/{objects => security_services}/models/auto_tag_actions_actions_inner_type_tagging.py (96%) rename scm/{objects => security_services}/models/auto_tag_actions_list_response.py (94%) diff --git a/.github/workflows/release-python-sdk.yml b/.github/workflows/release-python-sdk.yml index 131abf68..b5a58da7 100644 --- a/.github/workflows/release-python-sdk.yml +++ b/.github/workflows/release-python-sdk.yml @@ -1,35 +1,198 @@ -# Terraform Provider release workflow. +# Python SDK release workflow. +# +# Tag-driven release: pushing a "vX.Y.Z" tag is the trigger. Before publishing, +# the `check` job enforces two guards, either of which hard-fails the release: +# 1. The tag version (vX.Y.Z -> X.Y.Z) MUST equal the version in +# pyproject.toml. +# 2. That version must NOT already exist on PyPI (authoritative guard), so a +# mistaken or duplicate tag fails loudly instead of silently no-op'ing. +# +# Publishing uses PyPI Trusted Publishing (OIDC) and runs in the 'pypi' +# environment. If that environment has required reviewers, the upload waits for +# a manual approval: the trigger is automatic, the publish is gated. +# +# Release notes come from CHANGELOG.md: the `check` job extracts the section +# matching the released version (the `## [X.Y.Z]` heading) and fails the release +# early if no matching, non-empty section exists. That section becomes the +# GitHub Release body. The GitHub Release is cut against the tag that triggered +# this run. name: Release-Python-SDK -# This GitHub action creates a release when a tag that matches the pattern -# "v*" (e.g. v0.1.0) is created. on: push: tags: - 'v*' +concurrency: + # Never allow two publishes in flight; do not cancel an in-progress publish. + group: pypi-release + cancel-in-progress: false + jobs: - publish: - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Build - run: | - pip install build twine - python -m build - - - name: Check Distribution - run: twine check dist/* - - - name: Upload to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: twine upload dist/* \ No newline at end of file + check: + name: Check release + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + version: ${{ steps.gate.outputs.version }} + steps: + - uses: actions/checkout@v4 + + - name: Validate tag against pyproject and PyPI + id: gate + run: | + set -euo pipefail + + # Version from the tag that triggered this run (v1.2.3 -> 1.2.3). + TAG='${{ github.ref_name }}' + VERSION="${TAG#v}" + echo "Tag version: $VERSION" + + # Authoritative version read from pyproject (tomllib, not a grep). + PYPROJECT_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])") + echo "pyproject.toml version: $PYPROJECT_VERSION" + + # Guard 1: the tag MUST match pyproject. Mismatch is a hard error. + if [ "$VERSION" != "$PYPROJECT_VERSION" ]; then + echo "ERROR: tag $TAG (version $VERSION) does not match pyproject.toml version $PYPROJECT_VERSION." >&2 + echo "Bump pyproject.toml and the tag together, or delete and re-create the tag." >&2 + exit 1 + fi + + # Guard 2: PyPI existence check. 404 == new (safe to publish); anything + # else means the version already exists -> hard fail so a mistaken or + # duplicate tag is loud, not a silent no-op. + HTTP_CODE=$(curl -s -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/scm-python/$VERSION/json") + echo "PyPI lookup for $VERSION returned HTTP $HTTP_CODE" + + if [ "$HTTP_CODE" != "404" ]; then + echo "ERROR: version $VERSION already exists on PyPI (HTTP $HTTP_CODE)." >&2 + echo "Bump pyproject.toml to a new version and tag that, rather than re-tagging a published version." >&2 + exit 1 + fi + + echo "Will publish $VERSION." + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + + # Extract the CHANGELOG.md section for this version and HARD-FAIL the + # release if it is missing or empty. Runs in `check` (before the `pypi` + # environment approval gate) so a forgotten entry fails fast, not after a + # reviewer has already approved. The extracted notes are passed to the + # publish job as an artifact. + - name: Extract and validate release notes + env: + VERSION: ${{ steps.gate.outputs.version }} + run: | + set -euo pipefail + python3 - <<'PY' + import os, re, sys + + version = os.environ["VERSION"] + with open("CHANGELOG.md", encoding="utf-8") as fh: + lines = fh.readlines() + + # Match the version heading, e.g. "## [1.2.0] - 2026-06-05". + # The date suffix is ignored; "[Unreleased]" never matches. + heading = re.compile(r'^##\s+\[' + re.escape(version) + r'\]') + start = None + for i, line in enumerate(lines): + if heading.match(line): + start = i + 1 + break + + if start is None: + sys.exit( + f"ERROR: no CHANGELOG.md section for version {version} " + f"(expected a '## [{version}]' heading). Add an entry before releasing." + ) + + # Collect until the next level-2 heading ('## '); '### ' subsections stay. + body = [] + for line in lines[start:]: + if re.match(r'^## ', line): + break + body.append(line) + + # "Empty" means no real content: a section of only blank lines and + # empty '### Added/Changed/Fixed' buckets must fail the gate too. + content = [l for l in body if l.strip() and not re.match(r'^###\s', l)] + if not content: + sys.exit( + f"ERROR: CHANGELOG.md section for version {version} has no entries " + f"(only empty headings/blank lines). Add at least one change before releasing." + ) + + text = "".join(body).strip() + + with open("release-notes.md", "w", encoding="utf-8") as fh: + fh.write(text + "\n") + + print(f"Release notes for {version}:\n{text}") + PY + + - name: Upload release notes + uses: actions/upload-artifact@v4 + with: + name: release-notes + path: release-notes.md + retention-days: 1 + + publish: + name: Build and publish to PyPI + needs: check + runs-on: ubuntu-latest + # Publishing runs in the 'pypi' environment. Configure required reviewers on + # this environment in the repo settings (Settings -> Environments -> pypi) to + # gate every release behind a manual approval. The tag-push trigger is + # automatic; the actual upload waits for that approval. + environment: + name: pypi + url: https://pypi.org/p/scm-python + permissions: + # id-token: write is required for PyPI Trusted Publishing (OIDC) and for + # the PEP 740 provenance attestations emitted by gh-action-pypi-publish. + id-token: write + # contents: write is required to cut the GitHub Release. + contents: write + steps: + - uses: actions/checkout@v4 + + # Release notes curated by the `check` job from CHANGELOG.md. + - name: Download release notes + uses: actions/download-artifact@v4 + with: + name: release-notes + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Build + run: | + pip install build twine + python -m build + + - name: Check Distribution + run: twine check --strict dist/* + + # PyPI Trusted Publishing (OIDC): no stored API token. PyPI must have a + # publisher registered for owner=PaloAltoNetworks, repo=scm-python, + # workflow=release-python-sdk.yml, environment=pypi. Because scm-python is + # not yet on PyPI, register this as a PENDING publisher before the first + # run; the project is created on first successful upload. Provenance + # attestations are on by default. + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.14.0 + + # The tag already exists (it triggered this run); cut the GitHub Release + # against it using the CHANGELOG-derived notes. + - name: Create GitHub Release + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + TAG='${{ github.ref_name }}' + gh release create "$TAG" dist/* \ + --title "$TAG" \ + --notes-file release-notes.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c12eee4..667ab661 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ jobs: - config_setup - config_operations - device_settings + - mobile_agent steps: - name: Checkout code diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..8bafa2ba --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [0.0.1-beta.2] - 2026-06-05 + +### Added + +- Initial release of the Strata Cloud Manager (SCM) Python SDK. diff --git a/README.md b/README.md index a06c382f..669d31a9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # SCM Python SDK -[![PyPI version](https://img.shields.io/pypi/v/scm-python.svg)](https://pypi.org/project/scm-python/) [![Python versions](https://img.shields.io/pypi/pyversions/scm-python.svg)](https://pypi.org/project/scm-python/) [![License](https://img.shields.io/pypi/l/scm-python.svg)](https://github.com/PaloAltoNetworks/scm-python/blob/main/LICENSE) +[![PyPI version](https://img.shields.io/pypi/v/scm-python.svg)](https://pypi.org/project/scm-python/) [![Python versions](https://img.shields.io/pypi/pyversions/scm-python.svg)](https://pypi.org/project/scm-python/) [![License](https://img.shields.io/pypi/l/scm-python.svg)](https://github.com/PaloAltoNetworks/scm-python/blob/develop/LICENSE) -Auto-generated Python SDK for [Palo Alto Networks Strata Cloud Manager (SCM)](https://www.paloaltonetworks.com/strata-cloud-manager). +Auto-generated Python SDK for [Palo Alto Networks Strata Cloud Manager (SCM)](https://www.paloaltonetworks.com/network-security/strata-cloud-manager). ## Beta Release Disclaimer diff --git a/pyproject.toml b/pyproject.toml index 96bee611..9c7ba597 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "scm-python" -version = "0.0.1-beta.2" +version = "0.0.1-beta.1" description = "Palo Alto Networks Strata Cloud Manager (SCM) Python SDK" authors = [ - { name = "Palo Alto Networks", email = "devrel@paloaltonetworks.com" }, + { name = "Palo Alto Networks", email = "vnarayanan@paloaltonetworks.com" }, ] readme = "README.md" requires-python = ">=3.10" diff --git a/scm/network_services/tests/api_config_match_lists_test.py b/scm/network_services/tests/api_config_match_lists_test.py index 4a05c924..8d3985f4 100644 --- a/scm/network_services/tests/api_config_match_lists_test.py +++ b/scm/network_services/tests/api_config_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.config_match_list import ConfigMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,79 @@ def config_match_list_api(client): return client.network_services.ConfigMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for Config Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + id="", + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + id="", + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_config_match_list(config_match_list_api): +def clean_config_match_list(config_match_list_api, dependency_profiles): """ Fixture to create a temporary config match list for testing and automatically delete it after. """ @@ -38,10 +111,8 @@ def clean_config_match_list(config_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -66,7 +137,7 @@ def clean_config_match_list(config_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_config_match_list(config_match_list_api): +def test_create_config_match_list(config_match_list_api, dependency_profiles): """ Test manual creation and deletion of a config match list. """ @@ -77,7 +148,7 @@ def test_create_config_match_list(config_match_list_api): folder=TARGET_FOLDER, description="Test config match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) @@ -167,7 +238,7 @@ def test_fetch_config_match_list(config_match_list_api, clean_config_match_list) logger.info(f"\n[SUCCESS] fetch_config_match_list correctly returned None for non-existent object") -def test_delete_config_match_list_by_id(config_match_list_api): +def test_delete_config_match_list_by_id(config_match_list_api, dependency_profiles): """ Test deletion specifically. """ diff --git a/scm/network_services/tests/api_globalprotect_match_lists_test.py b/scm/network_services/tests/api_globalprotect_match_lists_test.py index deee08fb..e6ebeb8f 100644 --- a/scm/network_services/tests/api_globalprotect_match_lists_test.py +++ b/scm/network_services/tests/api_globalprotect_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.globalprotect_match_list import GlobalprotectMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,79 @@ def globalprotect_match_list_api(client): return client.network_services.GlobalprotectMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for GlobalProtect Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + id="", + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + id="", + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_globalprotect_match_list(globalprotect_match_list_api): +def clean_globalprotect_match_list(globalprotect_match_list_api, dependency_profiles): """ Fixture to create a temporary globalprotect match list for testing and automatically delete it after. """ @@ -38,11 +111,8 @@ def clean_globalprotect_match_list(globalprotect_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +137,7 @@ def clean_globalprotect_match_list(globalprotect_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_globalprotect_match_list(globalprotect_match_list_api): +def test_create_globalprotect_match_list(globalprotect_match_list_api, dependency_profiles): """ Test manual creation and deletion of a globalprotect match list. """ @@ -78,7 +148,7 @@ def test_create_globalprotect_match_list(globalprotect_match_list_api): folder=TARGET_FOLDER, description="Test globalprotect match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_hipmatch_match_lists_test.py b/scm/network_services/tests/api_hipmatch_match_lists_test.py index 7de89c84..3d73a21b 100644 --- a/scm/network_services/tests/api_hipmatch_match_lists_test.py +++ b/scm/network_services/tests/api_hipmatch_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.hipmatch_match_list import HipmatchMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,79 @@ def hipmatch_match_list_api(client): return client.network_services.HipmatchMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for HIP Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + id="", + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + id="", + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_hipmatch_match_list(hipmatch_match_list_api): +def clean_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): """ Fixture to create a temporary hipmatch match list for testing and automatically delete it after. """ @@ -38,11 +111,8 @@ def clean_hipmatch_match_list(hipmatch_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +137,7 @@ def clean_hipmatch_match_list(hipmatch_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_hipmatch_match_list(hipmatch_match_list_api): +def test_create_hipmatch_match_list(hipmatch_match_list_api, dependency_profiles): """ Test manual creation and deletion of a hipmatch match list. """ @@ -78,7 +148,7 @@ def test_create_hipmatch_match_list(hipmatch_match_list_api): folder=TARGET_FOLDER, description="Test hipmatch match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_ipsec_tunnels_test.py b/scm/network_services/tests/api_ipsec_tunnels_test.py index d6501648..7eb18f27 100644 --- a/scm/network_services/tests/api_ipsec_tunnels_test.py +++ b/scm/network_services/tests/api_ipsec_tunnels_test.py @@ -12,6 +12,8 @@ IkeGatewaysAuthentication, IkeGatewaysAuthenticationPreSharedKey, IkeGatewaysPeerAddress, + IkeGatewaysPeerId, + IkeGatewaysLocalId, IkeGatewaysProtocol, IkeGatewaysProtocolIkev1, IkeCryptoProfiles, @@ -69,6 +71,8 @@ def dependency_ike_gateway(ike_gw_api, ike_crypto_api): pre_shared_key=IkeGatewaysAuthenticationPreSharedKey(key="secret123") ), peer_address=IkeGatewaysPeerAddress(ip="1.1.1.1"), + peer_id=IkeGatewaysPeerId(type="ipaddr", id="10.3.3.4"), + local_id=IkeGatewaysLocalId(type="ipaddr", id="10.3.4.4"), protocol=IkeGatewaysProtocol( ikev1=IkeGatewaysProtocolIkev1(ike_crypto_profile=crypto_name), version="ikev1" diff --git a/scm/network_services/tests/api_iptag_match_lists_test.py b/scm/network_services/tests/api_iptag_match_lists_test.py index 37650b17..9ebfe42d 100644 --- a/scm/network_services/tests/api_iptag_match_lists_test.py +++ b/scm/network_services/tests/api_iptag_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.iptag_match_list import IptagMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,79 @@ def iptag_match_list_api(client): return client.network_services.IptagMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for IP Tag Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + id="", + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + id="", + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_iptag_match_list(iptag_match_list_api): +def clean_iptag_match_list(iptag_match_list_api, dependency_profiles): """ Fixture to create a temporary iptag match list for testing and automatically delete it after. """ @@ -38,11 +111,8 @@ def clean_iptag_match_list(iptag_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +137,7 @@ def clean_iptag_match_list(iptag_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_iptag_match_list(iptag_match_list_api): +def test_create_iptag_match_list(iptag_match_list_api, dependency_profiles): """ Test manual creation and deletion of an iptag match list. """ @@ -78,7 +148,7 @@ def test_create_iptag_match_list(iptag_match_list_api): folder=TARGET_FOLDER, description="Test iptag match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_system_match_lists_test.py b/scm/network_services/tests/api_system_match_lists_test.py index 523f862e..245d2269 100644 --- a/scm/network_services/tests/api_system_match_lists_test.py +++ b/scm/network_services/tests/api_system_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.system_match_list import SystemMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,79 @@ def system_match_list_api(client): return client.network_services.SystemMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for System Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + id="", + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + id="", + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_system_match_list(system_match_list_api): +def clean_system_match_list(system_match_list_api, dependency_profiles): """ Fixture to create a temporary system match list for testing and automatically delete it after. """ @@ -38,11 +111,8 @@ def clean_system_match_list(system_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +137,7 @@ def clean_system_match_list(system_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_system_match_list(system_match_list_api): +def test_create_system_match_list(system_match_list_api, dependency_profiles): """ Test manual creation and deletion of a system match list. """ @@ -78,7 +148,7 @@ def test_create_system_match_list(system_match_list_api): folder=TARGET_FOLDER, description="Test system match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/network_services/tests/api_userid_match_lists_test.py b/scm/network_services/tests/api_userid_match_lists_test.py index 4046b15b..90ea9073 100644 --- a/scm/network_services/tests/api_userid_match_lists_test.py +++ b/scm/network_services/tests/api_userid_match_lists_test.py @@ -4,6 +4,8 @@ import pytest from scm import Scm from scm.network_services.models.userid_match_list import UseridMatchList +from scm.objects.models.http_server_profiles import HttpServerProfiles, HttpServerProfilesServerInner +from scm.objects.models.syslog_server_profiles import SyslogServerProfiles, SyslogServerProfilesServerInner from scm.test_helpers import perform logging.basicConfig(level=logging.DEBUG) @@ -25,8 +27,79 @@ def userid_match_list_api(client): return client.network_services.UseridMatchListApi(client.network_services.api_client) +@pytest.fixture(scope="module") +def http_server_profiles_api(client): + return client.objects.HTTPServerProfilesApi(client.objects.api_client) + + +@pytest.fixture(scope="module") +def syslog_server_profiles_api(client): + return client.objects.SyslogServerProfilesApi(client.objects.api_client) + + +@pytest.fixture +def dependency_profiles(http_server_profiles_api, syslog_server_profiles_api): + """ + Creates HTTP and Syslog server profiles as dependencies for User ID Match List. + """ + random_id = uuid.uuid4().hex[:6] + + # Create HTTP Server Profile + http_name = f"test-http-{random_id}" + http_payload = HttpServerProfiles( + id="", + name=http_name, + folder=TARGET_FOLDER, + server=[HttpServerProfilesServerInner( + name="http-server-1", + address="192.168.1.100", + port=8080, + protocol="HTTP", + http_method="POST" + )] + ) + logger.info(f"\n[SETUP] Creating HTTP Server Profile: {http_name}") + http_obj = http_server_profiles_api.create_http_server_profiles(http_server_profiles=http_payload) + + # Create Syslog Server Profile (shortened name to stay under 31 char limit) + syslog_name = f"sys-{random_id}" + syslog_payload = SyslogServerProfiles( + id="", + name=syslog_name, + folder=TARGET_FOLDER, + server=[SyslogServerProfilesServerInner( + name="syslog-server-1", + server="192.168.1.101", + port=514, + format="BSD", + facility="LOG_USER", + transport="UDP" + )] + ) + logger.info(f"\n[SETUP] Creating Syslog Server Profile: {syslog_name}") + syslog_obj = syslog_server_profiles_api.create_syslog_server_profiles(syslog_server_profiles=syslog_payload) + + yield { + "http_name": http_name, + "http_id": http_obj.id, + "syslog_name": syslog_name, + "syslog_id": syslog_obj.id + } + + # Cleanup + logger.info(f"\n[TEARDOWN] Deleting dependency profiles") + try: + http_server_profiles_api.delete_http_server_profiles_by_id(id=http_obj.id) + except Exception as e: + logger.info(f"Failed to delete HTTP profile: {e}") + try: + syslog_server_profiles_api.delete_syslog_server_profiles_by_id(id=syslog_obj.id) + except Exception as e: + logger.info(f"Failed to delete Syslog profile: {e}") + + @pytest.fixture -def clean_userid_match_list(userid_match_list_api): +def clean_userid_match_list(userid_match_list_api, dependency_profiles): """ Fixture to create a temporary userid match list for testing and automatically delete it after. """ @@ -38,11 +111,8 @@ def clean_userid_match_list(userid_match_list_api): folder=TARGET_FOLDER, description="Created via Automated Pytest Fixture", filter="All Logs", - send_syslog=["test-syslog"], - send_http=["some-http-profile"], - send_snmptrap=["snmp_test"], - send_email=["test-email"], - quarantine=False, + send_syslog=[dependency_profiles["syslog_name"]], + send_http=[dependency_profiles["http_name"]], send_to_panorama=False ) @@ -67,7 +137,7 @@ def clean_userid_match_list(userid_match_list_api): logger.info(f"Teardown failed (might have been deleted in test): {e}") -def test_create_userid_match_list(userid_match_list_api): +def test_create_userid_match_list(userid_match_list_api, dependency_profiles): """ Test manual creation and deletion of a userid match list. """ @@ -78,7 +148,7 @@ def test_create_userid_match_list(userid_match_list_api): folder=TARGET_FOLDER, description="Test userid match list for create API testing", filter="All Logs", - send_syslog=["test-syslog"], + send_syslog=[dependency_profiles["syslog_name"]], send_to_panorama=False ) diff --git a/scm/objects/__init__.py b/scm/objects/__init__.py index 5705afe1..39ba59ae 100644 --- a/scm/objects/__init__.py +++ b/scm/objects/__init__.py @@ -23,7 +23,6 @@ from scm.objects.api.application_filters_api import ApplicationFiltersApi from scm.objects.api.application_groups_api import ApplicationGroupsApi from scm.objects.api.applications_api import ApplicationsApi -from scm.objects.api.auto_tag_actions_api import AutoTagActionsApi from scm.objects.api.dynamic_user_groups_api import DynamicUserGroupsApi from scm.objects.api.external_dynamic_lists_api import ExternalDynamicListsApi from scm.objects.api.hip_objects_api import HIPObjectsApi @@ -72,11 +71,6 @@ from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThan from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than_qualifier_inner import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThanQualifierInner from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_pattern_match import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorPatternMatch -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.objects.models.dynamic_user_groups import DynamicUserGroups from scm.objects.models.dynamic_user_groups_list_response import DynamicUserGroupsListResponse from scm.objects.models.error_detail_cause_info import ErrorDetailCauseInfo diff --git a/scm/objects/api/__init__.py b/scm/objects/api/__init__.py index e4e18ed0..6d622512 100644 --- a/scm/objects/api/__init__.py +++ b/scm/objects/api/__init__.py @@ -6,7 +6,6 @@ from scm.objects.api.application_filters_api import ApplicationFiltersApi from scm.objects.api.application_groups_api import ApplicationGroupsApi from scm.objects.api.applications_api import ApplicationsApi -from scm.objects.api.auto_tag_actions_api import AutoTagActionsApi from scm.objects.api.dynamic_user_groups_api import DynamicUserGroupsApi from scm.objects.api.external_dynamic_lists_api import ExternalDynamicListsApi from scm.objects.api.hip_objects_api import HIPObjectsApi diff --git a/scm/objects/models/__init__.py b/scm/objects/models/__init__.py index fd0e820e..0e9163d8 100644 --- a/scm/objects/models/__init__.py +++ b/scm/objects/models/__init__.py @@ -37,11 +37,6 @@ from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThan from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_greater_than_qualifier_inner import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorGreaterThanQualifierInner from scm.objects.models.applications_signature_inner_and_condition_inner_or_condition_inner_operator_pattern_match import ApplicationsSignatureInnerAndConditionInnerOrConditionInnerOperatorPatternMatch -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.objects.models.dynamic_user_groups import DynamicUserGroups from scm.objects.models.dynamic_user_groups_list_response import DynamicUserGroupsListResponse from scm.objects.models.error_detail_cause_info import ErrorDetailCauseInfo diff --git a/scm/objects/tests/api_auto_tag_actions_test.py b/scm/objects/tests/api_auto_tag_actions_test.py index 25f1fd9f..ad29925d 100644 --- a/scm/objects/tests/api_auto_tag_actions_test.py +++ b/scm/objects/tests/api_auto_tag_actions_test.py @@ -17,7 +17,7 @@ def client(): @pytest.fixture(scope="module") def auto_tag_actions_api(client): - return client.objects.AutoTagActionsApi(client.objects.api_client) + return client.security_services.AutoTagActionsApi(client.security_services.api_client) def test_list_auto_tag_actions(auto_tag_actions_api): diff --git a/scm/security_services/__init__.py b/scm/security_services/__init__.py index e0370840..f0211513 100644 --- a/scm/security_services/__init__.py +++ b/scm/security_services/__init__.py @@ -21,6 +21,7 @@ from scm.security_services.api.anti_spyware_profiles_api import AntiSpywareProfilesApi from scm.security_services.api.anti_spyware_signatures_api import AntiSpywareSignaturesApi from scm.security_services.api.application_override_rules_api import ApplicationOverrideRulesApi +from scm.security_services.api.auto_tag_actions_api import AutoTagActionsApi from scm.security_services.api.dns_security_profiles_api import DNSSecurityProfilesApi from scm.security_services.api.data_filtering_api import DataFilteringApi from scm.security_services.api.data_objects_api import DataObjectsApi @@ -83,6 +84,11 @@ from scm.security_services.models.anti_spyware_signatures_signature_standard_inner_and_condition_inner_or_condition_inner_operator_pattern_match import AntiSpywareSignaturesSignatureStandardInnerAndConditionInnerOrConditionInnerOperatorPatternMatch from scm.security_services.models.app_override_rules import AppOverrideRules from scm.security_services.models.application_override_rules_list_response import ApplicationOverrideRulesListResponse +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.security_services.models.base_rule_properties import BaseRuleProperties from scm.security_services.models.dns_security_profiles_list_response import DNSSecurityProfilesListResponse from scm.security_services.models.data_filtering_profiles import DataFilteringProfiles diff --git a/scm/security_services/api/__init__.py b/scm/security_services/api/__init__.py index 65c8fe5f..3637b815 100644 --- a/scm/security_services/api/__init__.py +++ b/scm/security_services/api/__init__.py @@ -4,6 +4,7 @@ from scm.security_services.api.anti_spyware_profiles_api import AntiSpywareProfilesApi from scm.security_services.api.anti_spyware_signatures_api import AntiSpywareSignaturesApi from scm.security_services.api.application_override_rules_api import ApplicationOverrideRulesApi +from scm.security_services.api.auto_tag_actions_api import AutoTagActionsApi from scm.security_services.api.dns_security_profiles_api import DNSSecurityProfilesApi from scm.security_services.api.data_filtering_api import DataFilteringApi from scm.security_services.api.data_objects_api import DataObjectsApi diff --git a/scm/objects/api/auto_tag_actions_api.py b/scm/security_services/api/auto_tag_actions_api.py similarity index 98% rename from scm/objects/api/auto_tag_actions_api.py rename to scm/security_services/api/auto_tag_actions_api.py index f3637a35..31f730f1 100644 --- a/scm/objects/api/auto_tag_actions_api.py +++ b/scm/security_services/api/auto_tag_actions_api.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,12 +20,12 @@ from pydantic import Field, StrictInt, StrictStr from typing import Optional from typing_extensions import Annotated -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse -from scm.objects.api_client import ApiClient, RequestSerialized -from scm.objects.api_response import ApiResponse -from scm.objects.rest import RESTResponseType +from scm.security_services.api_client import ApiClient, RequestSerialized +from scm.security_services.api_response import ApiResponse +from scm.security_services.rest import RESTResponseType from scm.decorators import with_error_handling diff --git a/scm/objects/docs/AutoTagActions.md b/scm/security_services/docs/AutoTagActions.md similarity index 95% rename from scm/objects/docs/AutoTagActions.md rename to scm/security_services/docs/AutoTagActions.md index 9cd21935..2dbd2a41 100644 --- a/scm/objects/docs/AutoTagActions.md +++ b/scm/security_services/docs/AutoTagActions.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions import AutoTagActions # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsActionsInner.md b/scm/security_services/docs/AutoTagActionsActionsInner.md similarity index 91% rename from scm/objects/docs/AutoTagActionsActionsInner.md rename to scm/security_services/docs/AutoTagActionsActionsInner.md index 5758581c..f26577f7 100644 --- a/scm/objects/docs/AutoTagActionsActionsInner.md +++ b/scm/security_services/docs/AutoTagActionsActionsInner.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsActionsInnerType.md b/scm/security_services/docs/AutoTagActionsActionsInnerType.md similarity index 90% rename from scm/objects/docs/AutoTagActionsActionsInnerType.md rename to scm/security_services/docs/AutoTagActionsActionsInnerType.md index 3ed205e2..f04a5fed 100644 --- a/scm/objects/docs/AutoTagActionsActionsInnerType.md +++ b/scm/security_services/docs/AutoTagActionsActionsInnerType.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md b/scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md similarity index 91% rename from scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md rename to scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md index 65b6e013..71335cda 100644 --- a/scm/objects/docs/AutoTagActionsActionsInnerTypeTagging.md +++ b/scm/security_services/docs/AutoTagActionsActionsInnerTypeTagging.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging # TODO update the JSON string below json = "{}" diff --git a/scm/objects/docs/AutoTagActionsApi.md b/scm/security_services/docs/AutoTagActionsApi.md similarity index 80% rename from scm/objects/docs/AutoTagActionsApi.md rename to scm/security_services/docs/AutoTagActionsApi.md index fb2243d5..233f7575 100644 --- a/scm/objects/docs/AutoTagActionsApi.md +++ b/scm/security_services/docs/AutoTagActionsApi.md @@ -1,6 +1,6 @@ -# scm.objects.AutoTagActionsApi +# scm.security_services.AutoTagActionsApi -All URIs are relative to *https://api.strata.paloaltonetworks.com/config/objects/v1* +All URIs are relative to *https://api.strata.paloaltonetworks.com/config/security/v1* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -22,15 +22,15 @@ Create a new auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -39,15 +39,15 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) - auto_tag_actions = scm.objects.AutoTagActions() # AutoTagActions | Created (optional) + api_instance = scm.security_services.AutoTagActionsApi(api_client) + auto_tag_actions = scm.security_services.AutoTagActions() # AutoTagActions | Created (optional) try: # Create an auto-tag action @@ -105,14 +105,14 @@ Delete an auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -121,14 +121,14 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) + api_instance = scm.security_services.AutoTagActionsApi(api_client) name = 'name_example' # str | The name of the configuration resource try: @@ -186,15 +186,15 @@ Retrieve a list of auto-tag actions * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -203,14 +203,14 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) + api_instance = scm.security_services.AutoTagActionsApi(api_client) name = 'name_example' # str | The name of the configuration resource (optional) offset = 0 # int | The offset into the list of results returned (optional) (default to 0) limit = 200 # int | The maximum number of results per page (optional) (default to 200) @@ -273,15 +273,15 @@ Update an existing auto-tag action. * Bearer (JWT) Authentication (scmToken): ```python -import scm.objects -from scm.objects.models.auto_tag_actions import AutoTagActions -from scm.objects.rest import ApiException +import scm.security_services +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.rest import ApiException from pprint import pprint -# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/objects/v1 +# Defining the host is optional and defaults to https://api.strata.paloaltonetworks.com/config/security/v1 # See configuration.py for a list of all supported configuration parameters. -configuration = scm.objects.Configuration( - host = "https://api.strata.paloaltonetworks.com/config/objects/v1" +configuration = scm.security_services.Configuration( + host = "https://api.strata.paloaltonetworks.com/config/security/v1" ) # The client must configure the authentication and authorization parameters @@ -290,15 +290,15 @@ configuration = scm.objects.Configuration( # satisfies your auth use case. # Configure Bearer authorization (JWT): scmToken -configuration = scm.objects.Configuration( +configuration = scm.security_services.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client -with scm.objects.ApiClient(configuration) as api_client: +with scm.security_services.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = scm.objects.AutoTagActionsApi(api_client) - auto_tag_actions = scm.objects.AutoTagActions() # AutoTagActions | OK (optional) + api_instance = scm.security_services.AutoTagActionsApi(api_client) + auto_tag_actions = scm.security_services.AutoTagActions() # AutoTagActions | OK (optional) try: # Update an auto-tag action diff --git a/scm/objects/docs/AutoTagActionsListResponse.md b/scm/security_services/docs/AutoTagActionsListResponse.md similarity index 92% rename from scm/objects/docs/AutoTagActionsListResponse.md rename to scm/security_services/docs/AutoTagActionsListResponse.md index 5712e845..087a90cf 100644 --- a/scm/objects/docs/AutoTagActionsListResponse.md +++ b/scm/security_services/docs/AutoTagActionsListResponse.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes ## Example ```python -from scm.objects.models.auto_tag_actions_list_response import AutoTagActionsListResponse +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse # TODO update the JSON string below json = "{}" diff --git a/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md b/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md index c2a0ce79..ba0496d4 100644 --- a/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md +++ b/scm/security_services/docs/DosProtectionProfilesFloodIcmpRed.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activate_rate** | **int** | Connection rate (cps) to start RED | [default to 10000] -**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [default to 10000] +**activate_rate** | **int** | Connection rate (cps) to start RED | [optional] [default to 10000] +**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [optional] [default to 10000] **block** | [**DosProtectionProfilesFloodIcmpRedBlock**](DosProtectionProfilesFloodIcmpRedBlock.md) | | [optional] -**maximal_rate** | **int** | Maximal connection rate (cps) allowed | [default to 40000] +**maximal_rate** | **int** | Maximal connection rate (cps) allowed | [optional] [default to 40000] ## Example diff --git a/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md b/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md index a680ace9..207e61a4 100644 --- a/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md +++ b/scm/security_services/docs/DosProtectionProfilesFloodTcpSynSynCookies.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activate_rate** | **int** | Connection rate (cps) to activate SYN cookies proxy | [default to 0] -**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [default to 10000] +**activate_rate** | **int** | Connection rate (cps) to activate SYN cookies proxy | [optional] [default to 0] +**alarm_rate** | **int** | Connection rate (cps) to generate alarm | [optional] [default to 10000] **block** | [**DosProtectionProfilesFloodTcpSynSynCookiesBlock**](DosProtectionProfilesFloodTcpSynSynCookiesBlock.md) | | [optional] -**maximal_rate** | **int** | Maximum connection rate (cps) allowed | [default to 1000000] +**maximal_rate** | **int** | Maximum connection rate (cps) allowed | [optional] [default to 1000000] ## Example diff --git a/scm/security_services/models/__init__.py b/scm/security_services/models/__init__.py index 4dba277a..202c93f3 100644 --- a/scm/security_services/models/__init__.py +++ b/scm/security_services/models/__init__.py @@ -44,6 +44,11 @@ from scm.security_services.models.anti_spyware_signatures_signature_standard_inner_and_condition_inner_or_condition_inner_operator_pattern_match import AntiSpywareSignaturesSignatureStandardInnerAndConditionInnerOrConditionInnerOperatorPatternMatch from scm.security_services.models.app_override_rules import AppOverrideRules from scm.security_services.models.application_override_rules_list_response import ApplicationOverrideRulesListResponse +from scm.security_services.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_list_response import AutoTagActionsListResponse from scm.security_services.models.base_rule_properties import BaseRuleProperties from scm.security_services.models.dns_security_profiles_list_response import DNSSecurityProfilesListResponse from scm.security_services.models.data_filtering_profiles import DataFilteringProfiles diff --git a/scm/objects/models/auto_tag_actions.py b/scm/security_services/models/auto_tag_actions.py similarity index 95% rename from scm/objects/models/auto_tag_actions.py rename to scm/security_services/models/auto_tag_actions.py index 9877b9fe..d3ced581 100644 --- a/scm/objects/models/auto_tag_actions.py +++ b/scm/security_services/models/auto_tag_actions.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from scm.objects.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner +from scm.security_services.models.auto_tag_actions_actions_inner import AutoTagActionsActionsInner from typing import Optional, Set from typing_extensions import Self diff --git a/scm/objects/models/auto_tag_actions_actions_inner.py b/scm/security_services/models/auto_tag_actions_actions_inner.py similarity index 91% rename from scm/objects/models/auto_tag_actions_actions_inner.py rename to scm/security_services/models/auto_tag_actions_actions_inner.py index 359782f8..dc2e6c84 100644 --- a/scm/objects/models/auto_tag_actions_actions_inner.py +++ b/scm/security_services/models/auto_tag_actions_actions_inner.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List -from scm.objects.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType +from scm.security_services.models.auto_tag_actions_actions_inner_type import AutoTagActionsActionsInnerType from typing import Optional, Set from typing_extensions import Self diff --git a/scm/objects/models/auto_tag_actions_actions_inner_type.py b/scm/security_services/models/auto_tag_actions_actions_inner_type.py similarity index 91% rename from scm/objects/models/auto_tag_actions_actions_inner_type.py rename to scm/security_services/models/auto_tag_actions_actions_inner_type.py index ce63a501..74a6f828 100644 --- a/scm/objects/models/auto_tag_actions_actions_inner_type.py +++ b/scm/security_services/models/auto_tag_actions_actions_inner_type.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List -from scm.objects.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging +from scm.security_services.models.auto_tag_actions_actions_inner_type_tagging import AutoTagActionsActionsInnerTypeTagging from typing import Optional, Set from typing_extensions import Self diff --git a/scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py b/scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py similarity index 96% rename from scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py rename to scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py index f28d1c1d..4f5386ee 100644 --- a/scm/objects/models/auto_tag_actions_actions_inner_type_tagging.py +++ b/scm/security_services/models/auto_tag_actions_actions_inner_type_tagging.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com diff --git a/scm/objects/models/auto_tag_actions_list_response.py b/scm/security_services/models/auto_tag_actions_list_response.py similarity index 94% rename from scm/objects/models/auto_tag_actions_list_response.py rename to scm/security_services/models/auto_tag_actions_list_response.py index 126c221e..75c1ae6d 100644 --- a/scm/objects/models/auto_tag_actions_list_response.py +++ b/scm/security_services/models/auto_tag_actions_list_response.py @@ -1,9 +1,9 @@ # coding: utf-8 """ - Objects + Security Services - These APIs are used for defining and managing policy object configurations within Strata Cloud Manager. + These APIs are used for defining and managing security services configurations within Strata Cloud Manager. The version of the OpenAPI document: 2.0.0 Contact: support@paloaltonetworks.com @@ -20,7 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List -from scm.objects.models.auto_tag_actions import AutoTagActions +from scm.security_services.models.auto_tag_actions import AutoTagActions from typing import Optional, Set from typing_extensions import Self diff --git a/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py b/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py index 1ec8e9cf..b00b01be 100644 --- a/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py +++ b/scm/security_services/models/dos_protection_profiles_flood_icmp_red.py @@ -29,10 +29,10 @@ class DosProtectionProfilesFloodIcmpRed(BaseModel): """ DosProtectionProfilesFloodIcmpRed """ # noqa: E501 - activate_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Connection rate (cps) to start RED", alias="activate-rate") - alarm_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to generate alarm", alias="alarm-rate") + activate_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=10000, description="Connection rate (cps) to start RED", alias="activate-rate") + alarm_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=10000, description="Connection rate (cps) to generate alarm", alias="alarm-rate") block: Optional[DosProtectionProfilesFloodIcmpRedBlock] = None - maximal_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Maximal connection rate (cps) allowed", alias="maximal-rate") + maximal_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=40000, description="Maximal connection rate (cps) allowed", alias="maximal-rate") __properties: ClassVar[List[str]] = ["activate-rate", "alarm-rate", "block", "maximal-rate"] model_config = ConfigDict( diff --git a/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py b/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py index 6c96babf..4d1cf2b8 100644 --- a/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py +++ b/scm/security_services/models/dos_protection_profiles_flood_tcp_syn_syn_cookies.py @@ -29,10 +29,10 @@ class DosProtectionProfilesFloodTcpSynSynCookies(BaseModel): """ DosProtectionProfilesFloodTcpSynSynCookies """ # noqa: E501 - activate_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to activate SYN cookies proxy", alias="activate-rate") - alarm_rate: Annotated[int, Field(le=2000000, strict=True, ge=0)] = Field(description="Connection rate (cps) to generate alarm", alias="alarm-rate") + activate_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=0, description="Connection rate (cps) to activate SYN cookies proxy", alias="activate-rate") + alarm_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=0)]] = Field(default=10000, description="Connection rate (cps) to generate alarm", alias="alarm-rate") block: Optional[DosProtectionProfilesFloodTcpSynSynCookiesBlock] = None - maximal_rate: Annotated[int, Field(le=2000000, strict=True, ge=1)] = Field(description="Maximum connection rate (cps) allowed", alias="maximal-rate") + maximal_rate: Optional[Annotated[int, Field(le=2000000, strict=True, ge=1)]] = Field(default=1000000, description="Maximum connection rate (cps) allowed", alias="maximal-rate") __properties: ClassVar[List[str]] = ["activate-rate", "alarm-rate", "block", "maximal-rate"] model_config = ConfigDict( From 6471fb1d2cad9bb5f83d460401628bcd90d8806d Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Fri, 5 Jun 2026 15:40:48 -0700 Subject: [PATCH 09/13] updated changelog to 0.0.1-beta.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bafa2ba..f09c4993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [0.0.1-beta.2] - 2026-06-05 +## [0.0.1-beta.1] - 2026-06-05 ### Added From d6435a5ad3e65045b3d7bdd402e4d62ada403086 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Thu, 11 Jun 2026 16:54:57 -0700 Subject: [PATCH 10/13] v0.0.1-beta.3 changes --- CHANGELOG.md | 12 ++++++++ README.md | 15 +++++----- pyproject.toml | 4 +-- .../tests/api_destinations_test.py | 30 ------------------- scm/network_services/docs/LogicalRouters.md | 1 - .../models/logical_routers.py | 14 +-------- .../tests/api_logical_routers_test.py | 6 ---- 7 files changed, 23 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f09c4993..52d8d9b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.0.1-beta.3] - 2026-06-11 + +### Added + +- Streamlined Beta release process of the Strata Cloud Manager (SCM) Python SDK. + +## [0.0.1-beta.2] - 2026-06-11 + +### Note + +Version 0.0.1-beta.2 was skipped. It was briefly published and then deleted from PyPI, and PyPI does not allow re-uploading a previously deleted version. + ## [0.0.1-beta.1] - 2026-06-05 ### Added diff --git a/README.md b/README.md index 669d31a9..3a02868e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SCM Python SDK -[![PyPI version](https://img.shields.io/pypi/v/scm-python.svg)](https://pypi.org/project/scm-python/) [![Python versions](https://img.shields.io/pypi/pyversions/scm-python.svg)](https://pypi.org/project/scm-python/) [![License](https://img.shields.io/pypi/l/scm-python.svg)](https://github.com/PaloAltoNetworks/scm-python/blob/develop/LICENSE) +[![PyPI version](https://img.shields.io/pypi/v/scm-python.svg)](https://pypi.org/project/scm-python/) [![Python versions](https://img.shields.io/pypi/pyversions/scm-python.svg)](https://pypi.org/project/scm-python/) [![License](https://img.shields.io/pypi/l/scm-python.svg)](https://github.com/PaloAltoNetworks/scm-python/blob/develop/LICENSE) [![PyPI - Weekly Downloads](https://img.shields.io/pypi/dw/scm-python.svg)](https://pypistats.org/packages/scm-python) [![PyPI - Monthly Downloads](https://img.shields.io/pypi/dm/scm-python.svg)](https://pypistats.org/packages/scm-python) [![PyPI - Total Downloads](https://img.shields.io/pypi/dd/scm-python.svg)](https://pypistats.org/packages/scm-python) Auto-generated Python SDK for [Palo Alto Networks Strata Cloud Manager (SCM)](https://www.paloaltonetworks.com/network-security/strata-cloud-manager). @@ -24,10 +24,10 @@ THIS SOFTWARE IS RELEASED AS A PROOF OF CONCEPT FOR EXPERIMENTAL PURPOSES ONLY. ## Table of contents -- [Installation](#installation) -- [Using scm-python](#using-scm-python) -- [Configuration File](#configuration-file) -- [Basic Usage Example](#basic-usage-example) +- Installation +- Using scm-python +- Configuration File +- Basic Usage Example ## Installation @@ -754,12 +754,13 @@ This SDK is **not compatible** with [pan-scm-sdk](https://github.com/cdot65/pan- ## Support -This is auto-generated code provided as-is for experimental purposes. See [SUPPORT.md](SUPPORT.md) for the support policy. +This is auto-generated code provided as-is for experimental purposes. See [SUPPORT.md](https://github.com/PaloAltoNetworks/sc +m-python/blob/main/SUPPORT.md) for the support policy. For issues or questions: 1. Check the [GitHub Issues](https://github.com/PaloAltoNetworks/scm-python/issues) -2. Review the [documentation](docs/) +2. Review the [documentation](https://github.com/PaloAltoNetworks/scm-python#readme/) ## License diff --git a/pyproject.toml b/pyproject.toml index 9c7ba597..a8f0e7e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "scm-python" -version = "0.0.1-beta.1" +version = "0.0.1-beta.3" description = "Palo Alto Networks Strata Cloud Manager (SCM) Python SDK" authors = [ { name = "Palo Alto Networks", email = "vnarayanan@paloaltonetworks.com" }, @@ -50,7 +50,7 @@ Homepage = "https://github.com/PaloAltoNetworks/scm-python" Documentation = "https://github.com/PaloAltoNetworks/scm-python#readme" Repository = "https://github.com/PaloAltoNetworks/scm-python" Issues = "https://github.com/PaloAltoNetworks/scm-python/issues" -Changelog = "https://github.com/PaloAltoNetworks/scm-python/blob/main/CHANGELOG.md" +Changelog = "https://github.com/PaloAltoNetworks/scm-python/blob/develop/CHANGELOG.md" [project.optional-dependencies] dev = [ diff --git a/scm/mobile_agent/tests/api_destinations_test.py b/scm/mobile_agent/tests/api_destinations_test.py index b468ebf8..78cdaa14 100644 --- a/scm/mobile_agent/tests/api_destinations_test.py +++ b/scm/mobile_agent/tests/api_destinations_test.py @@ -256,21 +256,6 @@ def test_delete_destination_by_id(destinations_api): logger.info(f"Successfully deleted ForwardingProfileDestinations: {created_obj.id}") -def test_get_destination_by_id_not_found(destinations_api): - """ - Test that fetching a non-existent destination returns 404. - Equivalent to Go: Test_mobile_agent_DestinationsAPIService_GetByID_NotFound - """ - from scm.exceptions import ObjectNotPresentError - - non_existent_id = "00000000-0000-0000-0000-000000000000" - - with pytest.raises(ObjectNotPresentError): - destinations_api.get_global_protect_destination_by_id(id=non_existent_id) - - logger.info(f"Correctly raised ObjectNotPresentError for non-existent destination") - - def test_update_destination_by_id_not_found(destinations_api): """ Test that updating a non-existent destination returns 404. @@ -300,21 +285,6 @@ def test_update_destination_by_id_not_found(destinations_api): logger.info(f"Correctly raised ObjectNotPresentError when updating non-existent destination") -def test_delete_destination_by_id_not_found(destinations_api): - """ - Test that deleting a non-existent destination returns 404. - Equivalent to Go: Test_mobile_agent_DestinationsAPIService_DeleteByID_NotFound - """ - from scm.exceptions import ObjectNotPresentError - - non_existent_id = "00000000-0000-0000-0000-000000000000" - - with pytest.raises(ObjectNotPresentError): - destinations_api.delete_global_protect_destination(id=non_existent_id) - - logger.info(f"Correctly raised ObjectNotPresentError when deleting non-existent destination") - - def test_delete_destination_verify_gone(destinations_api): """ Test that a deleted destination is no longer retrievable. diff --git a/scm/network_services/docs/LogicalRouters.md b/scm/network_services/docs/LogicalRouters.md index 633aa242..19ae6983 100644 --- a/scm/network_services/docs/LogicalRouters.md +++ b/scm/network_services/docs/LogicalRouters.md @@ -9,7 +9,6 @@ Name | Type | Description | Notes **folder** | **str** | The folder in which the resource is defined | [optional] **id** | **str** | UUID of the resource | [optional] [readonly] **name** | **str** | | -**routing_stack** | **str** | | [optional] **snippet** | **str** | The snippet in which the resource is defined | [optional] **vrf** | [**List[LogicalRoutersVrfInner]**](LogicalRoutersVrfInner.md) | | [optional] diff --git a/scm/network_services/models/logical_routers.py b/scm/network_services/models/logical_routers.py index 170a5e3c..9a5e7187 100644 --- a/scm/network_services/models/logical_routers.py +++ b/scm/network_services/models/logical_routers.py @@ -33,10 +33,9 @@ class LogicalRouters(BaseModel): folder: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="The folder in which the resource is defined") id: Optional[StrictStr] = Field(default=None, description="UUID of the resource") name: StrictStr - routing_stack: Optional[StrictStr] = None snippet: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="The snippet in which the resource is defined") vrf: Optional[List[LogicalRoutersVrfInner]] = None - __properties: ClassVar[List[str]] = ["device", "folder", "id", "name", "routing_stack", "snippet", "vrf"] + __properties: ClassVar[List[str]] = ["device", "folder", "id", "name", "snippet", "vrf"] @field_validator('device') def device_validate_regular_expression(cls, value): @@ -58,16 +57,6 @@ def folder_validate_regular_expression(cls, value): raise ValueError(r"must validate the regular expression /^[a-zA-Z\d\-_\. ]+$/") return value - @field_validator('routing_stack') - def routing_stack_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['legacy', 'advanced']): - raise ValueError("must be one of enum values ('legacy', 'advanced')") - return value - @field_validator('snippet') def snippet_validate_regular_expression(cls, value): """Validates the regular expression""" @@ -142,7 +131,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "folder": obj.get("folder"), "id": obj.get("id"), "name": obj.get("name"), - "routing_stack": obj.get("routing_stack"), "snippet": obj.get("snippet"), "vrf": [LogicalRoutersVrfInner.from_dict(_item) for _item in obj["vrf"]] if obj.get("vrf") is not None else None }) diff --git a/scm/network_services/tests/api_logical_routers_test.py b/scm/network_services/tests/api_logical_routers_test.py index b6767f6e..ae4cd197 100644 --- a/scm/network_services/tests/api_logical_routers_test.py +++ b/scm/network_services/tests/api_logical_routers_test.py @@ -64,7 +64,6 @@ def create_test_logical_router_payload(name_prefix): return LogicalRouters( name=name, folder=TARGET_FOLDER, - routing_stack="advanced", vrf=[vrf] ) @@ -101,7 +100,6 @@ def test_create_logical_router(lr_api): assert created_obj.id is not None assert created_obj.name == payload.name - assert created_obj.routing_stack == "advanced" assert len(created_obj.vrf) == 1 # Cleanup @@ -115,7 +113,6 @@ def test_get_logical_router_by_id(lr_api, clean_logical_router): fetched_obj = lr_api.get_logical_routers_by_id(id=clean_logical_router.id) assert fetched_obj.id == clean_logical_router.id assert fetched_obj.name == clean_logical_router.name - assert fetched_obj.routing_stack == "advanced" def test_update_logical_router(lr_api, clean_logical_router): @@ -125,10 +122,8 @@ def test_update_logical_router(lr_api, clean_logical_router): update_payload = clean_logical_router # NOTE: Changing routing stack might be restricted depending on backend, # but we follow the Go test example which updates it. - # update_payload.routing_stack = "legacy" # Let's update something safer if that fails, but stick to Go logic for now - # Go test updates routing_stack to 'legacy' # IMPORTANT: Ensure nested objects (VRF) are preserved in payload @@ -138,7 +133,6 @@ def test_update_logical_router(lr_api, clean_logical_router): # ) # assert updated_obj.id == clean_logical_router.id - # assert updated_obj.routing_stack == "legacy" pass # Skipped actual update logic validation pending exact field support From ac43d731e66a96e63215f370871f9e89ed7e33e9 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Tue, 23 Jun 2026 16:50:03 -0700 Subject: [PATCH 11/13] ZTNA Support --- scm/__init__.py | 25 + scm/ztna_connector_all/__init__.py | 82 + scm/ztna_connector_all/api/__init__.py | 11 + scm/ztna_connector_all/api/connector_api.py | 6432 +++++++++++++++++ .../api/connector_group_api.py | 4666 ++++++++++++ .../api/discovered_application_api.py | 702 ++ scm/ztna_connector_all/api/fqdn_api.py | 1895 +++++ scm/ztna_connector_all/api/subnet_api.py | 1895 +++++ scm/ztna_connector_all/api/tenant_api.py | 1115 +++ scm/ztna_connector_all/api/wildcard_api.py | 1895 +++++ scm/ztna_connector_all/api_client.py | 798 ++ scm/ztna_connector_all/api_response.py | 21 + scm/ztna_connector_all/configuration.py | 460 ++ scm/ztna_connector_all/docs/Applications.md | 39 + .../docs/ApplicationsListResponse.md | 32 + .../docs/ApplicationsSpecInner.md | 33 + scm/ztna_connector_all/docs/ConnectorApi.md | 1798 +++++ .../docs/ConnectorGroupApi.md | 1261 ++++ .../docs/ConnectorGroupConnectors.md | 30 + .../ConnectorGroupConnectorsConnectors.md | 32 + .../docs/ConnectorGroupFqdnRules.md | 30 + .../docs/ConnectorGroupScheduledUpgrade.md | 33 + .../docs/ConnectorGroupStatus.md | 36 + .../docs/ConnectorGroupStatusCounts.md | 32 + .../docs/ConnectorGroupSubnetRules.md | 30 + .../docs/ConnectorGroupUpgradeStatus.md | 33 + .../ConnectorGroupUpgradeStatusDataInner.md | 37 + .../docs/ConnectorGroupWildcards.md | 30 + .../docs/ConnectorGroups.md | 37 + .../docs/ConnectorGroupsListResponse.md | 32 + .../docs/ConnectorQuiesce.md | 29 + .../docs/ConnectorScheduledUpgrade.md | 31 + .../docs/ConnectorStatus.md | 49 + .../docs/ConnectorStatusFlags.md | 33 + .../docs/ConnectorStatusFlagsCapabilities.md | 30 + .../docs/ConnectorUpgradeStatus.md | 38 + scm/ztna_connector_all/docs/Connectors.md | 34 + .../docs/ConnectorsListResponse.md | 32 + .../docs/DiagnosticFileList.md | 29 + .../docs/DiagnosticFileListDataInner.md | 33 + .../docs/DiscoveredApplicationApi.md | 182 + .../docs/DiscoveredApplications.md | 32 + ...DiscoveredApplicationsApplicationsInner.md | 35 + ...plicationsApplicationsInnerAppSpecInner.md | 31 + .../DiscoveredApplicationsListResponse.md | 32 + scm/ztna_connector_all/docs/ErrorDetail.md | 32 + .../docs/ErrorDetailCausesInner.md | 30 + scm/ztna_connector_all/docs/ErrorObject.md | 32 + scm/ztna_connector_all/docs/ErrorResponse.md | 30 + scm/ztna_connector_all/docs/FQDNApi.md | 509 ++ scm/ztna_connector_all/docs/LicenseInfo.md | 34 + scm/ztna_connector_all/docs/PacketCapture.md | 31 + .../docs/PacketCaptureCreate.md | 32 + .../docs/StartTenantOffboarding202Response.md | 29 + scm/ztna_connector_all/docs/SubnetApi.md | 509 ++ scm/ztna_connector_all/docs/Subnets.md | 37 + .../docs/SubnetsListResponse.md | 32 + scm/ztna_connector_all/docs/TenantApi.md | 324 + scm/ztna_connector_all/docs/TenantStatus.md | 29 + scm/ztna_connector_all/docs/WildcardApi.md | 509 ++ scm/ztna_connector_all/docs/Wildcards.md | 45 + .../docs/WildcardsListResponse.md | 32 + scm/ztna_connector_all/exceptions.py | 200 + scm/ztna_connector_all/models/__init__.py | 59 + scm/ztna_connector_all/models/applications.py | 132 + .../models/applications_list_response.py | 113 + .../models/applications_spec_inner.py | 114 + .../models/connector_group_connectors.py | 98 + .../connector_group_connectors_connectors.py | 99 + .../models/connector_group_fqdn_rules.py | 98 + .../connector_group_scheduled_upgrade.py | 97 + .../models/connector_group_status.py | 106 + .../models/connector_group_status_counts.py | 94 + .../models/connector_group_subnet_rules.py | 98 + .../models/connector_group_upgrade_status.py | 104 + ...nnector_group_upgrade_status_data_inner.py | 104 + .../models/connector_group_wildcards.py | 98 + .../models/connector_groups.py | 128 + .../models/connector_groups_list_response.py | 113 + .../models/connector_quiesce.py | 88 + .../models/connector_scheduled_upgrade.py | 93 + .../models/connector_status.py | 142 + .../models/connector_status_flags.py | 100 + .../connector_status_flags_capabilities.py | 90 + .../models/connector_upgrade_status.py | 106 + scm/ztna_connector_all/models/connectors.py | 122 + .../models/connectors_list_response.py | 113 + .../models/diagnostic_file_list.py | 96 + .../models/diagnostic_file_list_data_inner.py | 106 + .../models/discovered_applications.py | 102 + ...covered_applications_applications_inner.py | 108 + ...tions_applications_inner_app_spec_inner.py | 92 + .../discovered_applications_list_response.py | 113 + scm/ztna_connector_all/models/error_detail.py | 100 + .../models/error_detail_causes_inner.py | 90 + scm/ztna_connector_all/models/error_object.py | 100 + .../models/error_response.py | 92 + scm/ztna_connector_all/models/license_info.py | 99 + .../models/packet_capture.py | 92 + .../models/packet_capture_create.py | 94 + .../start_tenant_offboarding202_response.py | 88 + scm/ztna_connector_all/models/subnets.py | 128 + .../models/subnets_list_response.py | 113 + .../models/tenant_status.py | 95 + scm/ztna_connector_all/models/wildcards.py | 158 + .../models/wildcards_list_response.py | 113 + scm/ztna_connector_all/rest.py | 264 + 107 files changed, 31430 insertions(+) create mode 100644 scm/ztna_connector_all/__init__.py create mode 100644 scm/ztna_connector_all/api/__init__.py create mode 100644 scm/ztna_connector_all/api/connector_api.py create mode 100644 scm/ztna_connector_all/api/connector_group_api.py create mode 100644 scm/ztna_connector_all/api/discovered_application_api.py create mode 100644 scm/ztna_connector_all/api/fqdn_api.py create mode 100644 scm/ztna_connector_all/api/subnet_api.py create mode 100644 scm/ztna_connector_all/api/tenant_api.py create mode 100644 scm/ztna_connector_all/api/wildcard_api.py create mode 100644 scm/ztna_connector_all/api_client.py create mode 100644 scm/ztna_connector_all/api_response.py create mode 100644 scm/ztna_connector_all/configuration.py create mode 100644 scm/ztna_connector_all/docs/Applications.md create mode 100644 scm/ztna_connector_all/docs/ApplicationsListResponse.md create mode 100644 scm/ztna_connector_all/docs/ApplicationsSpecInner.md create mode 100644 scm/ztna_connector_all/docs/ConnectorApi.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupApi.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupConnectors.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupConnectorsConnectors.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupFqdnRules.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupScheduledUpgrade.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupStatus.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupStatusCounts.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupSubnetRules.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatus.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatusDataInner.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupWildcards.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroups.md create mode 100644 scm/ztna_connector_all/docs/ConnectorGroupsListResponse.md create mode 100644 scm/ztna_connector_all/docs/ConnectorQuiesce.md create mode 100644 scm/ztna_connector_all/docs/ConnectorScheduledUpgrade.md create mode 100644 scm/ztna_connector_all/docs/ConnectorStatus.md create mode 100644 scm/ztna_connector_all/docs/ConnectorStatusFlags.md create mode 100644 scm/ztna_connector_all/docs/ConnectorStatusFlagsCapabilities.md create mode 100644 scm/ztna_connector_all/docs/ConnectorUpgradeStatus.md create mode 100644 scm/ztna_connector_all/docs/Connectors.md create mode 100644 scm/ztna_connector_all/docs/ConnectorsListResponse.md create mode 100644 scm/ztna_connector_all/docs/DiagnosticFileList.md create mode 100644 scm/ztna_connector_all/docs/DiagnosticFileListDataInner.md create mode 100644 scm/ztna_connector_all/docs/DiscoveredApplicationApi.md create mode 100644 scm/ztna_connector_all/docs/DiscoveredApplications.md create mode 100644 scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInner.md create mode 100644 scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInnerAppSpecInner.md create mode 100644 scm/ztna_connector_all/docs/DiscoveredApplicationsListResponse.md create mode 100644 scm/ztna_connector_all/docs/ErrorDetail.md create mode 100644 scm/ztna_connector_all/docs/ErrorDetailCausesInner.md create mode 100644 scm/ztna_connector_all/docs/ErrorObject.md create mode 100644 scm/ztna_connector_all/docs/ErrorResponse.md create mode 100644 scm/ztna_connector_all/docs/FQDNApi.md create mode 100644 scm/ztna_connector_all/docs/LicenseInfo.md create mode 100644 scm/ztna_connector_all/docs/PacketCapture.md create mode 100644 scm/ztna_connector_all/docs/PacketCaptureCreate.md create mode 100644 scm/ztna_connector_all/docs/StartTenantOffboarding202Response.md create mode 100644 scm/ztna_connector_all/docs/SubnetApi.md create mode 100644 scm/ztna_connector_all/docs/Subnets.md create mode 100644 scm/ztna_connector_all/docs/SubnetsListResponse.md create mode 100644 scm/ztna_connector_all/docs/TenantApi.md create mode 100644 scm/ztna_connector_all/docs/TenantStatus.md create mode 100644 scm/ztna_connector_all/docs/WildcardApi.md create mode 100644 scm/ztna_connector_all/docs/Wildcards.md create mode 100644 scm/ztna_connector_all/docs/WildcardsListResponse.md create mode 100644 scm/ztna_connector_all/exceptions.py create mode 100644 scm/ztna_connector_all/models/__init__.py create mode 100644 scm/ztna_connector_all/models/applications.py create mode 100644 scm/ztna_connector_all/models/applications_list_response.py create mode 100644 scm/ztna_connector_all/models/applications_spec_inner.py create mode 100644 scm/ztna_connector_all/models/connector_group_connectors.py create mode 100644 scm/ztna_connector_all/models/connector_group_connectors_connectors.py create mode 100644 scm/ztna_connector_all/models/connector_group_fqdn_rules.py create mode 100644 scm/ztna_connector_all/models/connector_group_scheduled_upgrade.py create mode 100644 scm/ztna_connector_all/models/connector_group_status.py create mode 100644 scm/ztna_connector_all/models/connector_group_status_counts.py create mode 100644 scm/ztna_connector_all/models/connector_group_subnet_rules.py create mode 100644 scm/ztna_connector_all/models/connector_group_upgrade_status.py create mode 100644 scm/ztna_connector_all/models/connector_group_upgrade_status_data_inner.py create mode 100644 scm/ztna_connector_all/models/connector_group_wildcards.py create mode 100644 scm/ztna_connector_all/models/connector_groups.py create mode 100644 scm/ztna_connector_all/models/connector_groups_list_response.py create mode 100644 scm/ztna_connector_all/models/connector_quiesce.py create mode 100644 scm/ztna_connector_all/models/connector_scheduled_upgrade.py create mode 100644 scm/ztna_connector_all/models/connector_status.py create mode 100644 scm/ztna_connector_all/models/connector_status_flags.py create mode 100644 scm/ztna_connector_all/models/connector_status_flags_capabilities.py create mode 100644 scm/ztna_connector_all/models/connector_upgrade_status.py create mode 100644 scm/ztna_connector_all/models/connectors.py create mode 100644 scm/ztna_connector_all/models/connectors_list_response.py create mode 100644 scm/ztna_connector_all/models/diagnostic_file_list.py create mode 100644 scm/ztna_connector_all/models/diagnostic_file_list_data_inner.py create mode 100644 scm/ztna_connector_all/models/discovered_applications.py create mode 100644 scm/ztna_connector_all/models/discovered_applications_applications_inner.py create mode 100644 scm/ztna_connector_all/models/discovered_applications_applications_inner_app_spec_inner.py create mode 100644 scm/ztna_connector_all/models/discovered_applications_list_response.py create mode 100644 scm/ztna_connector_all/models/error_detail.py create mode 100644 scm/ztna_connector_all/models/error_detail_causes_inner.py create mode 100644 scm/ztna_connector_all/models/error_object.py create mode 100644 scm/ztna_connector_all/models/error_response.py create mode 100644 scm/ztna_connector_all/models/license_info.py create mode 100644 scm/ztna_connector_all/models/packet_capture.py create mode 100644 scm/ztna_connector_all/models/packet_capture_create.py create mode 100644 scm/ztna_connector_all/models/start_tenant_offboarding202_response.py create mode 100644 scm/ztna_connector_all/models/subnets.py create mode 100644 scm/ztna_connector_all/models/subnets_list_response.py create mode 100644 scm/ztna_connector_all/models/tenant_status.py create mode 100644 scm/ztna_connector_all/models/wildcards.py create mode 100644 scm/ztna_connector_all/models/wildcards_list_response.py create mode 100644 scm/ztna_connector_all/rest.py diff --git a/scm/__init__.py b/scm/__init__.py index 133108f3..6b866e91 100644 --- a/scm/__init__.py +++ b/scm/__init__.py @@ -40,6 +40,9 @@ from scm.security_services import api as security_services_api from scm.security_services.api_client import ApiClient as SecurityServicesApiClient from scm.security_services.configuration import Configuration as SecurityServicesConfiguration +from scm.ztna_connector_all import api as ztna_connector_all_api +from scm.ztna_connector_all.api_client import ApiClient as ZtnaConnectorAllApiClient +from scm.ztna_connector_all.configuration import Configuration as ZtnaConnectorAllConfiguration # Set up logging logging.basicConfig(level=logging.ERROR) @@ -335,6 +338,7 @@ def __init__( self.network_services = self._init_network_services_client() self.objects = self._init_objects_client() self.security_services = self._init_security_services_client() + self.ztna_connector_all = self._init_ztna_connector_all_client() def _load_config_from_file(self) -> Dict[str, Any]: """ @@ -527,6 +531,8 @@ def _update_all_sub_clients(self) -> None: self.objects.api_client.configuration.access_token = self._access_token if hasattr(self, 'security_services') and hasattr(self.security_services, 'api_client'): self.security_services.api_client.configuration.access_token = self._access_token + if hasattr(self, 'ztna_connector_all') and hasattr(self.ztna_connector_all, 'api_client'): + self.ztna_connector_all.api_client.configuration.access_token = self._access_token @property def token_expires_soon(self) -> bool: @@ -718,3 +724,22 @@ def _init_security_services_client(self): security_services_api.api_client = client return security_services_api + def _init_ztna_connector_all_client(self): + # Construct base URL by appending the service-specific path suffix + # Host: https://api.sase.paloaltonetworks.com + # Suffix: + config = ZtnaConnectorAllConfiguration( + host=f"https://{self.host}" + ) + config.verify_ssl = self.verify_ssl + config.access_token = self._access_token + + client = ZtnaConnectorAllApiClient(config) + + # Wrap the rest client's request method to auto-refresh tokens + client.rest_client.request = _create_auto_refresh_wrapper( + self, client.rest_client.request + ) + + ztna_connector_all_api.api_client = client + return ztna_connector_all_api diff --git a/scm/ztna_connector_all/__init__.py b/scm/ztna_connector_all/__init__.py new file mode 100644 index 00000000..5aa4330f --- /dev/null +++ b/scm/ztna_connector_all/__init__.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +# flake8: noqa + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# import apis into sdk package +from scm.ztna_connector_all.api.connector_api import ConnectorApi +from scm.ztna_connector_all.api.connector_group_api import ConnectorGroupApi +from scm.ztna_connector_all.api.discovered_application_api import DiscoveredApplicationApi +from scm.ztna_connector_all.api.fqdn_api import FQDNApi +from scm.ztna_connector_all.api.subnet_api import SubnetApi +from scm.ztna_connector_all.api.tenant_api import TenantApi +from scm.ztna_connector_all.api.wildcard_api import WildcardApi + +# import ApiClient +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.api_client import ApiClient +from scm.ztna_connector_all.configuration import Configuration +from scm.ztna_connector_all.exceptions import OpenApiException +from scm.ztna_connector_all.exceptions import ApiTypeError +from scm.ztna_connector_all.exceptions import ApiValueError +from scm.ztna_connector_all.exceptions import ApiKeyError +from scm.ztna_connector_all.exceptions import ApiAttributeError +from scm.ztna_connector_all.exceptions import ApiException + +# import models into sdk package +from scm.ztna_connector_all.models.applications import Applications +from scm.ztna_connector_all.models.applications_list_response import ApplicationsListResponse +from scm.ztna_connector_all.models.applications_spec_inner import ApplicationsSpecInner +from scm.ztna_connector_all.models.connector_group_connectors import ConnectorGroupConnectors +from scm.ztna_connector_all.models.connector_group_connectors_connectors import ConnectorGroupConnectorsConnectors +from scm.ztna_connector_all.models.connector_group_fqdn_rules import ConnectorGroupFqdnRules +from scm.ztna_connector_all.models.connector_group_scheduled_upgrade import ConnectorGroupScheduledUpgrade +from scm.ztna_connector_all.models.connector_group_status import ConnectorGroupStatus +from scm.ztna_connector_all.models.connector_group_status_counts import ConnectorGroupStatusCounts +from scm.ztna_connector_all.models.connector_group_subnet_rules import ConnectorGroupSubnetRules +from scm.ztna_connector_all.models.connector_group_upgrade_status import ConnectorGroupUpgradeStatus +from scm.ztna_connector_all.models.connector_group_upgrade_status_data_inner import ConnectorGroupUpgradeStatusDataInner +from scm.ztna_connector_all.models.connector_group_wildcards import ConnectorGroupWildcards +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from scm.ztna_connector_all.models.connector_groups_list_response import ConnectorGroupsListResponse +from scm.ztna_connector_all.models.connector_quiesce import ConnectorQuiesce +from scm.ztna_connector_all.models.connector_scheduled_upgrade import ConnectorScheduledUpgrade +from scm.ztna_connector_all.models.connector_status import ConnectorStatus +from scm.ztna_connector_all.models.connector_status_flags import ConnectorStatusFlags +from scm.ztna_connector_all.models.connector_status_flags_capabilities import ConnectorStatusFlagsCapabilities +from scm.ztna_connector_all.models.connector_upgrade_status import ConnectorUpgradeStatus +from scm.ztna_connector_all.models.connectors import Connectors +from scm.ztna_connector_all.models.connectors_list_response import ConnectorsListResponse +from scm.ztna_connector_all.models.diagnostic_file_list import DiagnosticFileList +from scm.ztna_connector_all.models.diagnostic_file_list_data_inner import DiagnosticFileListDataInner +from scm.ztna_connector_all.models.discovered_applications import DiscoveredApplications +from scm.ztna_connector_all.models.discovered_applications_applications_inner import DiscoveredApplicationsApplicationsInner +from scm.ztna_connector_all.models.discovered_applications_applications_inner_app_spec_inner import DiscoveredApplicationsApplicationsInnerAppSpecInner +from scm.ztna_connector_all.models.discovered_applications_list_response import DiscoveredApplicationsListResponse +from scm.ztna_connector_all.models.error_detail import ErrorDetail +from scm.ztna_connector_all.models.error_detail_causes_inner import ErrorDetailCausesInner +from scm.ztna_connector_all.models.error_object import ErrorObject +from scm.ztna_connector_all.models.error_response import ErrorResponse +from scm.ztna_connector_all.models.license_info import LicenseInfo +from scm.ztna_connector_all.models.packet_capture import PacketCapture +from scm.ztna_connector_all.models.packet_capture_create import PacketCaptureCreate +from scm.ztna_connector_all.models.start_tenant_offboarding202_response import StartTenantOffboarding202Response +from scm.ztna_connector_all.models.subnets import Subnets +from scm.ztna_connector_all.models.subnets_list_response import SubnetsListResponse +from scm.ztna_connector_all.models.tenant_status import TenantStatus +from scm.ztna_connector_all.models.wildcards import Wildcards +from scm.ztna_connector_all.models.wildcards_list_response import WildcardsListResponse diff --git a/scm/ztna_connector_all/api/__init__.py b/scm/ztna_connector_all/api/__init__.py new file mode 100644 index 00000000..afeb5955 --- /dev/null +++ b/scm/ztna_connector_all/api/__init__.py @@ -0,0 +1,11 @@ +# flake8: noqa + +# import apis into api package +from scm.ztna_connector_all.api.connector_api import ConnectorApi +from scm.ztna_connector_all.api.connector_group_api import ConnectorGroupApi +from scm.ztna_connector_all.api.discovered_application_api import DiscoveredApplicationApi +from scm.ztna_connector_all.api.fqdn_api import FQDNApi +from scm.ztna_connector_all.api.subnet_api import SubnetApi +from scm.ztna_connector_all.api.tenant_api import TenantApi +from scm.ztna_connector_all.api.wildcard_api import WildcardApi + diff --git a/scm/ztna_connector_all/api/connector_api.py b/scm/ztna_connector_all/api/connector_api.py new file mode 100644 index 00000000..98de0f98 --- /dev/null +++ b/scm/ztna_connector_all/api/connector_api.py @@ -0,0 +1,6432 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.connector_quiesce import ConnectorQuiesce +from scm.ztna_connector_all.models.connector_scheduled_upgrade import ConnectorScheduledUpgrade +from scm.ztna_connector_all.models.connector_upgrade_status import ConnectorUpgradeStatus +from scm.ztna_connector_all.models.connectors import Connectors +from scm.ztna_connector_all.models.connectors_list_response import ConnectorsListResponse +from scm.ztna_connector_all.models.diagnostic_file_list import DiagnosticFileList +from scm.ztna_connector_all.models.packet_capture import PacketCapture +from scm.ztna_connector_all.models.packet_capture_create import PacketCaptureCreate + +from scm.ztna_connector_all.api_client import ApiClient, RequestSerialized +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class ConnectorApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_connectors( + self, + connectors: Connectors, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create Connector + + + :param connectors: (required) + :type connectors: Connectors + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_serialize( + connectors=connectors, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_with_http_info( + self, + connectors: Connectors, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Create Connector + + + :param connectors: (required) + :type connectors: Connectors + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_serialize( + connectors=connectors, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_without_preload_content( + self, + connectors: Connectors, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector + + + :param connectors: (required) + :type connectors: Connectors + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_serialize( + connectors=connectors, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_connectors_serialize( + self, + connectors, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if connectors is not None: + _body_params = connectors + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connectors', + 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 + @with_error_handling + def create_connectors_pcaps_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + packet_capture_create: PacketCaptureCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PacketCapture: + """Start Connector Packet Capture + + This API will start a packet capture operation on the ZTNA connector. The Interface information must be provided in the API. + + :param oid: Object ID (required) + :type oid: str + :param packet_capture_create: (required) + :type packet_capture_create: PacketCaptureCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_pcaps_by_id_serialize( + oid=oid, + packet_capture_create=packet_capture_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacketCapture", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_pcaps_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + packet_capture_create: PacketCaptureCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[PacketCapture]: + """Start Connector Packet Capture + + This API will start a packet capture operation on the ZTNA connector. The Interface information must be provided in the API. + + :param oid: Object ID (required) + :type oid: str + :param packet_capture_create: (required) + :type packet_capture_create: PacketCaptureCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_pcaps_by_id_serialize( + oid=oid, + packet_capture_create=packet_capture_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacketCapture", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_pcaps_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + packet_capture_create: PacketCaptureCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Packet Capture + + This API will start a packet capture operation on the ZTNA connector. The Interface information must be provided in the API. + + :param oid: Object ID (required) + :type oid: str + :param packet_capture_create: (required) + :type packet_capture_create: PacketCaptureCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_pcaps_by_id_serialize( + oid=oid, + packet_capture_create=packet_capture_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacketCapture", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_connectors_pcaps_by_id_serialize( + self, + oid, + packet_capture_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if packet_capture_create is not None: + _body_params = packet_capture_create + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/pcaps', + 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 + @with_error_handling + def create_connectors_scheduled_upgrade_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_scheduled_upgrade: ConnectorScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_scheduled_upgrade: (required) + :type connector_scheduled_upgrade: ConnectorScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + connector_scheduled_upgrade=connector_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_scheduled_upgrade_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_scheduled_upgrade: ConnectorScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Create Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_scheduled_upgrade: (required) + :type connector_scheduled_upgrade: ConnectorScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + connector_scheduled_upgrade=connector_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_scheduled_upgrade_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_scheduled_upgrade: ConnectorScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_scheduled_upgrade: (required) + :type connector_scheduled_upgrade: ConnectorScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + connector_scheduled_upgrade=connector_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_connectors_scheduled_upgrade_by_id_serialize( + self, + oid, + connector_scheduled_upgrade, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if connector_scheduled_upgrade is not None: + _body_params = connector_scheduled_upgrade + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/scheduled-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 + ) + + + + + @validate_call + @with_error_handling + def create_connectors_tech_support_files_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Start Connector Tech Support Generation + + This API will start a tech support operation on the ZTNA connector. In the current implementation it uses the \"dump tech-support\" command to generate the data. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_tech_support_files_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_tech_support_files_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Start Connector Tech Support Generation + + This API will start a tech support operation on the ZTNA connector. In the current implementation it uses the \"dump tech-support\" command to generate the data. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_tech_support_files_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def create_connectors_tech_support_files_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Tech Support Generation + + This API will start a tech support operation on the ZTNA connector. In the current implementation it uses the \"dump tech-support\" command to generate the data. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_tech_support_files_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_connectors_tech_support_files_by_id_serialize( + self, + oid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/tech-support-files', + 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 + @with_error_handling + def delete_connectors_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connectors_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connectors_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_connectors_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sse/connector/v2.0/api/connectors/{oid}', + 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 + @with_error_handling + def delete_connectors_scheduled_upgrade_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connectors_scheduled_upgrade_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connectors_scheduled_upgrade_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_connectors_scheduled_upgrade_by_id_serialize( + self, + oid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/scheduled-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 + ) + + + + + @validate_call + @with_error_handling + def download_connectors_pcaps_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Download Connector Packet Capture File + + This API downloads the captured packet file from the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._download_connectors_pcaps_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def download_connectors_pcaps_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Download Connector Packet Capture File + + This API downloads the captured packet file from the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._download_connectors_pcaps_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def download_connectors_pcaps_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Download Connector Packet Capture File + + This API downloads the captured packet file from the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._download_connectors_pcaps_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _download_connectors_pcaps_by_id_serialize( + self, + oid, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/pcaps/{id}:download', + 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 + @with_error_handling + def download_connectors_tech_support_files_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Download Connector Tech Support File + + This API downloads a tech support file from the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._download_connectors_tech_support_files_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def download_connectors_tech_support_files_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Download Connector Tech Support File + + This API downloads a tech support file from the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._download_connectors_tech_support_files_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def download_connectors_tech_support_files_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Download Connector Tech Support File + + This API downloads a tech support file from the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._download_connectors_tech_support_files_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _download_connectors_tech_support_files_by_id_serialize( + self, + oid, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/tech-support-files/{id}:download', + 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 + @with_error_handling + def get_connectors_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Connectors: + """Get Connector + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Connectors", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[Connectors]: + """Get Connector + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Connectors", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Connectors", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_connectors_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}', + 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 + @with_error_handling + def get_connectors_quiesce_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorQuiesce: + """Get Connector Quiesce State + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_quiesce_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorQuiesce", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + '424': "ErrorResponse", + '5XX': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_quiesce_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorQuiesce]: + """Get Connector Quiesce State + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_quiesce_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorQuiesce", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + '424': "ErrorResponse", + '5XX': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_quiesce_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Quiesce State + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_quiesce_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorQuiesce", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + '424': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_connectors_quiesce_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/quiesce', + 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 + @with_error_handling + def get_connectors_scheduled_upgrade_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorScheduledUpgrade: + """Get Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorScheduledUpgrade", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_scheduled_upgrade_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorScheduledUpgrade]: + """Get Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorScheduledUpgrade", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_scheduled_upgrade_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorScheduledUpgrade", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_connectors_scheduled_upgrade_by_id_serialize( + self, + oid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/scheduled-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 + ) + + + + + @validate_call + @with_error_handling + def get_connectors_scheduled_upgrade_status_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorUpgradeStatus: + """Get Connector Scheduled Upgrade Status + + Retrieves the detailed scheduled upgrade status for a specific connector + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_status_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorUpgradeStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + '5XX': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_scheduled_upgrade_status_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorUpgradeStatus]: + """Get Connector Scheduled Upgrade Status + + Retrieves the detailed scheduled upgrade status for a specific connector + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_status_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorUpgradeStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + '5XX': "ErrorResponse", + } + 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 + @with_error_handling + def get_connectors_scheduled_upgrade_status_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Scheduled Upgrade Status + + Retrieves the detailed scheduled upgrade status for a specific connector + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_status_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorUpgradeStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_connectors_scheduled_upgrade_status_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/scheduled-upgrade-status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_connector_filters( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List Connector Filters + + Get filter values for connector fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_filters_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[List[str]]: + """List Connector Filters + + Get filter values for connector fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_filters_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Filters + + Get filter values for connector fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_filters_serialize( + self, + x_panw_region, + var_field, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if var_field is not None: + + _query_params.append(('field', var_field)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/filters', + 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 + @with_error_handling + def list_connector_images( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List Connector Image Versions + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_images_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_images_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[str]]: + """List Connector Image Versions + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_images_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_images_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Connector Image Versions + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_images_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_images_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-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 + @with_error_handling + def list_connectors( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorsListResponse: + """List Connectors + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connectors_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorsListResponse]: + """List Connectors + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connectors_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connectors + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connectors_serialize( + self, + x_panw_region, + offset, + limit, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors', + 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 + @with_error_handling + def list_connectors_pcaps_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiagnosticFileList: + """List Connector Packet Capture Files + + This API is used to get the list of captured packet files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_pcaps_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiagnosticFileList", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connectors_pcaps_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[DiagnosticFileList]: + """List Connector Packet Capture Files + + This API is used to get the list of captured packet files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_pcaps_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiagnosticFileList", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connectors_pcaps_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Packet Capture Files + + This API is used to get the list of captured packet files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_pcaps_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiagnosticFileList", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connectors_pcaps_by_id_serialize( + self, + oid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/pcaps', + 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 + @with_error_handling + def list_connectors_tech_support_files_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiagnosticFileList: + """List Connector Tech Support Files + + This API is used to get the list the available \"dump tech-support\" data files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_tech_support_files_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiagnosticFileList", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connectors_tech_support_files_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[DiagnosticFileList]: + """List Connector Tech Support Files + + This API is used to get the list the available \"dump tech-support\" data files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_tech_support_files_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiagnosticFileList", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connectors_tech_support_files_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Tech Support Files + + This API is used to get the list the available \"dump tech-support\" data files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_tech_support_files_by_id_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiagnosticFileList", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connectors_tech_support_files_by_id_serialize( + self, + oid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/tech-support-files', + 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 + @with_error_handling + def stop_connectors_pcaps_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PacketCapture: + """Stop Connector Packet Capture + + This API will stop an in-progress packet capture operation on the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_connectors_pcaps_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacketCapture", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def stop_connectors_pcaps_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[PacketCapture]: + """Stop Connector Packet Capture + + This API will stop an in-progress packet capture operation on the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_connectors_pcaps_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacketCapture", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def stop_connectors_pcaps_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Packet Capture + + This API will stop an in-progress packet capture operation on the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_connectors_pcaps_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PacketCapture", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stop_connectors_pcaps_by_id_serialize( + self, + oid, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/pcaps/{id}: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 + ) + + + + + @validate_call + @with_error_handling + def stop_connectors_tech_support_files_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Stop Connector Tech Support Generation + + This API will stop an in-progress tech support operation on the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_connectors_tech_support_files_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def stop_connectors_tech_support_files_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Stop Connector Tech Support Generation + + This API will stop an in-progress tech support operation on the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_connectors_tech_support_files_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def stop_connectors_tech_support_files_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + id: Annotated[StrictStr, Field(description="request id")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Tech Support Generation + + This API will stop an in-progress tech support operation on the ZTNA connector. + + :param oid: Object ID (required) + :type oid: str + :param id: request id (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._stop_connectors_tech_support_files_by_id_serialize( + oid=oid, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _stop_connectors_tech_support_files_by_id_serialize( + self, + oid, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/tech-support-files/{id}: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 + ) + + + + + @validate_call + @with_error_handling + def update_connectors_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connectors: Connectors, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Connector + + + :param oid: Object ID (required) + :type oid: str + :param connectors: (required) + :type connectors: Connectors + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + connectors=connectors, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_connectors_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connectors: Connectors, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update Connector + + + :param oid: Object ID (required) + :type oid: str + :param connectors: (required) + :type connectors: Connectors + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + connectors=connectors, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_connectors_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connectors: Connectors, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector + + + :param oid: Object ID (required) + :type oid: str + :param connectors: (required) + :type connectors: Connectors + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_by_id_serialize( + oid=oid, + connectors=connectors, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_connectors_by_id_serialize( + self, + oid, + connectors, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if connectors is not None: + _body_params = connectors + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/connectors/{oid}', + 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 + @with_error_handling + def update_connectors_quiesce_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_quiesce: ConnectorQuiesce, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Connector Quiesce State + + + :param oid: Object ID (required) + :type oid: str + :param connector_quiesce: (required) + :type connector_quiesce: ConnectorQuiesce + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_quiesce_by_id_serialize( + oid=oid, + connector_quiesce=connector_quiesce, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + '424': "ErrorResponse", + '5XX': "ErrorResponse", + } + 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 + @with_error_handling + def update_connectors_quiesce_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_quiesce: ConnectorQuiesce, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update Connector Quiesce State + + + :param oid: Object ID (required) + :type oid: str + :param connector_quiesce: (required) + :type connector_quiesce: ConnectorQuiesce + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_quiesce_by_id_serialize( + oid=oid, + connector_quiesce=connector_quiesce, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + '424': "ErrorResponse", + '5XX': "ErrorResponse", + } + 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 + @with_error_handling + def update_connectors_quiesce_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_quiesce: ConnectorQuiesce, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Quiesce State + + + :param oid: Object ID (required) + :type oid: str + :param connector_quiesce: (required) + :type connector_quiesce: ConnectorQuiesce + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_quiesce_by_id_serialize( + oid=oid, + connector_quiesce=connector_quiesce, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + '424': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_connectors_quiesce_by_id_serialize( + self, + oid, + connector_quiesce, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if connector_quiesce is not None: + _body_params = connector_quiesce + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/quiesce', + 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 + @with_error_handling + def update_connectors_scheduled_upgrade_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_scheduled_upgrade: ConnectorScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_scheduled_upgrade: (required) + :type connector_scheduled_upgrade: ConnectorScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + connector_scheduled_upgrade=connector_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def update_connectors_scheduled_upgrade_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_scheduled_upgrade: ConnectorScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_scheduled_upgrade: (required) + :type connector_scheduled_upgrade: ConnectorScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + connector_scheduled_upgrade=connector_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def update_connectors_scheduled_upgrade_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_scheduled_upgrade: ConnectorScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_scheduled_upgrade: (required) + :type connector_scheduled_upgrade: ConnectorScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connectors_scheduled_upgrade_by_id_serialize( + oid=oid, + connector_scheduled_upgrade=connector_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_connectors_scheduled_upgrade_by_id_serialize( + self, + oid, + connector_scheduled_upgrade, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if connector_scheduled_upgrade is not None: + _body_params = connector_scheduled_upgrade + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/connectors/{oid}/scheduled-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 + ) + + diff --git a/scm/ztna_connector_all/api/connector_group_api.py b/scm/ztna_connector_all/api/connector_group_api.py new file mode 100644 index 00000000..54858874 --- /dev/null +++ b/scm/ztna_connector_all/api/connector_group_api.py @@ -0,0 +1,4666 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.connector_group_connectors import ConnectorGroupConnectors +from scm.ztna_connector_all.models.connector_group_fqdn_rules import ConnectorGroupFqdnRules +from scm.ztna_connector_all.models.connector_group_scheduled_upgrade import ConnectorGroupScheduledUpgrade +from scm.ztna_connector_all.models.connector_group_subnet_rules import ConnectorGroupSubnetRules +from scm.ztna_connector_all.models.connector_group_upgrade_status import ConnectorGroupUpgradeStatus +from scm.ztna_connector_all.models.connector_group_wildcards import ConnectorGroupWildcards +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from scm.ztna_connector_all.models.connector_groups_list_response import ConnectorGroupsListResponse + +from scm.ztna_connector_all.api_client import ApiClient, RequestSerialized +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class ConnectorGroupApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_connector_group( + self, + connector_groups: ConnectorGroups, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create Connector Group + + + :param connector_groups: (required) + :type connector_groups: ConnectorGroups + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_serialize( + connector_groups=connector_groups, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_connector_group_with_http_info( + self, + connector_groups: ConnectorGroups, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Create Connector Group + + + :param connector_groups: (required) + :type connector_groups: ConnectorGroups + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_serialize( + connector_groups=connector_groups, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_connector_group_without_preload_content( + self, + connector_groups: ConnectorGroups, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group + + + :param connector_groups: (required) + :type connector_groups: ConnectorGroups + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_serialize( + connector_groups=connector_groups, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_connector_group_serialize( + self, + connector_groups, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if connector_groups is not None: + _body_params = connector_groups + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connector-groups', + 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 + @with_error_handling + def create_connector_group_scheduled_upgrade( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_group_scheduled_upgrade: (required) + :type connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + connector_group_scheduled_upgrade=connector_group_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def create_connector_group_scheduled_upgrade_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Create Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_group_scheduled_upgrade: (required) + :type connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + connector_group_scheduled_upgrade=connector_group_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def create_connector_group_scheduled_upgrade_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_group_scheduled_upgrade: (required) + :type connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + connector_group_scheduled_upgrade=connector_group_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_connector_group_scheduled_upgrade_serialize( + self, + oid, + connector_group_scheduled_upgrade, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if connector_group_scheduled_upgrade is not None: + _body_params = connector_group_scheduled_upgrade + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/scheduled-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 + ) + + + + + @validate_call + @with_error_handling + def delete_connector_group_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connector_group_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connector_group_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_connector_group_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}', + 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 + @with_error_handling + def delete_connector_group_scheduled_upgrade( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connector_group_scheduled_upgrade_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def delete_connector_group_scheduled_upgrade_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_connector_group_scheduled_upgrade_serialize( + self, + oid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/scheduled-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 + ) + + + + + @validate_call + @with_error_handling + def get_connector_group_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroups: + """Get Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroups", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connector_group_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroups]: + """Get Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroups", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connector_group_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroups", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_connector_group_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}', + 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 + @with_error_handling + def get_connector_group_scheduled_upgrade( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroupScheduledUpgrade: + """Get Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupScheduledUpgrade", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connector_group_scheduled_upgrade_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroupScheduledUpgrade]: + """Get Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupScheduledUpgrade", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connector_group_scheduled_upgrade_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupScheduledUpgrade", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_connector_group_scheduled_upgrade_serialize( + self, + oid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/scheduled-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 + ) + + + + + @validate_call + @with_error_handling + def get_connector_group_scheduled_upgrade_status( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroupUpgradeStatus: + """Get Connector Group Scheduled Upgrade Status + + Retrieves the scheduled upgrade status for a connector group, including the upgrade status of all connectors in the group + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_status_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupUpgradeStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connector_group_scheduled_upgrade_status_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroupUpgradeStatus]: + """Get Connector Group Scheduled Upgrade Status + + Retrieves the scheduled upgrade status for a connector group, including the upgrade status of all connectors in the group + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_status_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupUpgradeStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_connector_group_scheduled_upgrade_status_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Scheduled Upgrade Status + + Retrieves the scheduled upgrade status for a connector group, including the upgrade status of all connectors in the group + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_status_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupUpgradeStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_connector_group_scheduled_upgrade_status_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/scheduled-upgrade-status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def list_connector_group_applications( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroupFqdnRules: + """List FQDNs per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_applications_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupFqdnRules", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_applications_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroupFqdnRules]: + """List FQDNs per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_applications_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupFqdnRules", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_applications_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDNs per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_applications_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupFqdnRules", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_group_applications_serialize( + self, + oid, + x_panw_region, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/applications', + 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 + @with_error_handling + def list_connector_group_connectors( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroupConnectors: + """List Connectors per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_connectors_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupConnectors", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_connectors_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroupConnectors]: + """List Connectors per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_connectors_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupConnectors", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_connectors_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connectors per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_connectors_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupConnectors", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_group_connectors_serialize( + self, + oid, + x_panw_region, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/connectors', + 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 + @with_error_handling + def list_connector_group_filters( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List Connector Group Filters + + Get filter values for connector group fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_filters_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[List[str]]: + """List Connector Group Filters + + Get filter values for connector group fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_filters_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Filters + + Get filter values for connector group fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_group_filters_serialize( + self, + x_panw_region, + var_field, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if var_field is not None: + + _query_params.append(('field', var_field)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/filters', + 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 + @with_error_handling + def list_connector_group_subnets( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroupSubnetRules: + """List Subnets per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_subnets_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupSubnetRules", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_subnets_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroupSubnetRules]: + """List Subnets per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_subnets_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupSubnetRules", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_subnets_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnets per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_subnets_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupSubnetRules", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_group_subnets_serialize( + self, + oid, + x_panw_region, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/subnets', + 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 + @with_error_handling + def list_connector_group_wildcards( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroupWildcards: + """List Wildcards per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_wildcards_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupWildcards", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_wildcards_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroupWildcards]: + """List Wildcards per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_wildcards_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupWildcards", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_group_wildcards_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcards per Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_wildcards_serialize( + oid=oid, + x_panw_region=x_panw_region, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupWildcards", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_group_wildcards_serialize( + self, + oid, + x_panw_region, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/wildcards', + 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 + @with_error_handling + def list_connector_groups( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConnectorGroupsListResponse: + """List Connector Groups + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_groups_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_groups_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ConnectorGroupsListResponse]: + """List Connector Groups + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_groups_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_connector_groups_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Groups + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_groups_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConnectorGroupsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_connector_groups_serialize( + self, + x_panw_region, + offset, + limit, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/connector-groups', + 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 + @with_error_handling + def update_connector_group_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_groups: ConnectorGroups, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param connector_groups: (required) + :type connector_groups: ConnectorGroups + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + connector_groups=connector_groups, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_connector_group_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_groups: ConnectorGroups, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param connector_groups: (required) + :type connector_groups: ConnectorGroups + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + connector_groups=connector_groups, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_connector_group_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_groups: ConnectorGroups, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group + + + :param oid: Object ID (required) + :type oid: str + :param connector_groups: (required) + :type connector_groups: ConnectorGroups + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_by_id_serialize( + oid=oid, + connector_groups=connector_groups, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_connector_group_by_id_serialize( + self, + oid, + connector_groups, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if connector_groups is not None: + _body_params = connector_groups + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}', + 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 + @with_error_handling + def update_connector_group_scheduled_upgrade( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_group_scheduled_upgrade: (required) + :type connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + connector_group_scheduled_upgrade=connector_group_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def update_connector_group_scheduled_upgrade_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_group_scheduled_upgrade: (required) + :type connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + connector_group_scheduled_upgrade=connector_group_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def update_connector_group_scheduled_upgrade_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Connector Group Scheduled Upgrade + + + :param oid: Object ID (required) + :type oid: str + :param connector_group_scheduled_upgrade: (required) + :type connector_group_scheduled_upgrade: ConnectorGroupScheduledUpgrade + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_connector_group_scheduled_upgrade_serialize( + oid=oid, + connector_group_scheduled_upgrade=connector_group_scheduled_upgrade, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_connector_group_scheduled_upgrade_serialize( + self, + oid, + connector_group_scheduled_upgrade, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if connector_group_scheduled_upgrade is not None: + _body_params = connector_group_scheduled_upgrade + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/connector-groups/{oid}/scheduled-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 + ) + + diff --git a/scm/ztna_connector_all/api/discovered_application_api.py b/scm/ztna_connector_all/api/discovered_application_api.py new file mode 100644 index 00000000..d7418144 --- /dev/null +++ b/scm/ztna_connector_all/api/discovered_application_api.py @@ -0,0 +1,702 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.discovered_applications_list_response import DiscoveredApplicationsListResponse + +from scm.ztna_connector_all.api_client import ApiClient, RequestSerialized +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class DiscoveredApplicationApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def list_discovered_application_filters( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List Discovered Application Filters + + Get filter values for discovered application fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_discovered_application_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_discovered_application_filters_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[List[str]]: + """List Discovered Application Filters + + Get filter values for discovered application fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_discovered_application_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_discovered_application_filters_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Discovered Application Filters + + Get filter values for discovered application fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_discovered_application_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_discovered_application_filters_serialize( + self, + x_panw_region, + var_field, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if var_field is not None: + + _query_params.append(('field', var_field)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/discovered-applications/filters', + 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 + @with_error_handling + def list_discovered_applications( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DiscoveredApplicationsListResponse: + """List Discovered Applications + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_discovered_applications_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscoveredApplicationsListResponse", + '202': "ErrorResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_discovered_applications_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[DiscoveredApplicationsListResponse]: + """List Discovered Applications + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_discovered_applications_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscoveredApplicationsListResponse", + '202': "ErrorResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_discovered_applications_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Discovered Applications + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_discovered_applications_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DiscoveredApplicationsListResponse", + '202': "ErrorResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_discovered_applications_serialize( + self, + x_panw_region, + offset, + limit, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/discovered-applications', + 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/scm/ztna_connector_all/api/fqdn_api.py b/scm/ztna_connector_all/api/fqdn_api.py new file mode 100644 index 00000000..14cdbf51 --- /dev/null +++ b/scm/ztna_connector_all/api/fqdn_api.py @@ -0,0 +1,1895 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.applications import Applications +from scm.ztna_connector_all.models.applications_list_response import ApplicationsListResponse + +from scm.ztna_connector_all.api_client import ApiClient, RequestSerialized +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class FQDNApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_applications( + self, + applications: Applications, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create FQDN + + + :param applications: (required) + :type applications: Applications + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_serialize( + applications=applications, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_applications_with_http_info( + self, + applications: Applications, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Create FQDN + + + :param applications: (required) + :type applications: Applications + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_serialize( + applications=applications, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_applications_without_preload_content( + self, + applications: Applications, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDN + + + :param applications: (required) + :type applications: Applications + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_serialize( + applications=applications, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_applications_serialize( + self, + applications, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if applications is not None: + _body_params = applications + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/applications', + 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 + @with_error_handling + def delete_applications_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDN + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_applications_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDN + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_applications_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDN + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_applications_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sse/connector/v2.0/api/applications/{oid}', + 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 + @with_error_handling + def get_applications_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Applications: + """Get FQDN + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Applications", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_applications_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[Applications]: + """Get FQDN + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Applications", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_applications_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDN + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Applications", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_applications_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/applications/{oid}', + 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 + @with_error_handling + def list_application_filters( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List FQDN Filters + + Get filter values for FQDN rule fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_application_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_application_filters_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[List[str]]: + """List FQDN Filters + + Get filter values for FQDN rule fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_application_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_application_filters_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDN Filters + + Get filter values for FQDN rule fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_application_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_application_filters_serialize( + self, + x_panw_region, + var_field, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if var_field is not None: + + _query_params.append(('field', var_field)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/applications/filters', + 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 + @with_error_handling + def list_applications( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApplicationsListResponse: + """List FQDNs + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApplicationsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_applications_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[ApplicationsListResponse]: + """List FQDNs + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApplicationsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_applications_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDNs + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApplicationsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_applications_serialize( + self, + x_panw_region, + offset, + limit, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/applications', + 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 + @with_error_handling + def update_applications_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + applications: Applications, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update FQDN + + + :param oid: Object ID (required) + :type oid: str + :param applications: (required) + :type applications: Applications + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + applications=applications, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_applications_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + applications: Applications, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update FQDN + + + :param oid: Object ID (required) + :type oid: str + :param applications: (required) + :type applications: Applications + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + applications=applications, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_applications_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + applications: Applications, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 FQDN + + + :param oid: Object ID (required) + :type oid: str + :param applications: (required) + :type applications: Applications + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_applications_by_id_serialize( + oid=oid, + applications=applications, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_applications_by_id_serialize( + self, + oid, + applications, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if applications is not None: + _body_params = applications + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/applications/{oid}', + 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/scm/ztna_connector_all/api/subnet_api.py b/scm/ztna_connector_all/api/subnet_api.py new file mode 100644 index 00000000..85ff5138 --- /dev/null +++ b/scm/ztna_connector_all/api/subnet_api.py @@ -0,0 +1,1895 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.subnets import Subnets +from scm.ztna_connector_all.models.subnets_list_response import SubnetsListResponse + +from scm.ztna_connector_all.api_client import ApiClient, RequestSerialized +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class SubnetApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_subnet( + self, + subnets: Subnets, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create Subnet + + + :param subnets: (required) + :type subnets: Subnets + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_serialize( + subnets=subnets, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_subnet_with_http_info( + self, + subnets: Subnets, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Create Subnet + + + :param subnets: (required) + :type subnets: Subnets + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_serialize( + subnets=subnets, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_subnet_without_preload_content( + self, + subnets: Subnets, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnet + + + :param subnets: (required) + :type subnets: Subnets + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_serialize( + subnets=subnets, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_subnet_serialize( + self, + subnets, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if subnets is not None: + _body_params = subnets + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/subnets', + 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 + @with_error_handling + def delete_subnet_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnet + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_subnet_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnet + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_subnet_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnet + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_subnet_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sse/connector/v2.0/api/subnets/{oid}', + 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 + @with_error_handling + def get_subnet_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Subnets: + """Get Subnet + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Subnets", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_subnet_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[Subnets]: + """Get Subnet + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Subnets", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_subnet_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnet + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Subnets", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_subnet_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/subnets/{oid}', + 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 + @with_error_handling + def list_subnet_filters( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List Subnet Filters + + Get filter values for subnet rule fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_subnet_filters_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[List[str]]: + """List Subnet Filters + + Get filter values for subnet rule fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_subnet_filters_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnet Filters + + Get filter values for subnet rule fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_subnet_filters_serialize( + self, + x_panw_region, + var_field, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if var_field is not None: + + _query_params.append(('field', var_field)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/subnets/filters', + 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 + @with_error_handling + def list_subnets( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SubnetsListResponse: + """List Subnets + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnets_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubnetsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_subnets_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[SubnetsListResponse]: + """List Subnets + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnets_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubnetsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_subnets_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnets + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnets_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubnetsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_subnets_serialize( + self, + x_panw_region, + offset, + limit, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/subnets', + 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 + @with_error_handling + def update_subnet_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + subnets: Subnets, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Subnet + + + :param oid: Object ID (required) + :type oid: str + :param subnets: (required) + :type subnets: Subnets + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + subnets=subnets, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_subnet_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + subnets: Subnets, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update Subnet + + + :param oid: Object ID (required) + :type oid: str + :param subnets: (required) + :type subnets: Subnets + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + subnets=subnets, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_subnet_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + subnets: Subnets, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Subnet + + + :param oid: Object ID (required) + :type oid: str + :param subnets: (required) + :type subnets: Subnets + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_subnet_by_id_serialize( + oid=oid, + subnets=subnets, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_subnet_by_id_serialize( + self, + oid, + subnets, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if subnets is not None: + _body_params = subnets + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/subnets/{oid}', + 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/scm/ztna_connector_all/api/tenant_api.py b/scm/ztna_connector_all/api/tenant_api.py new file mode 100644 index 00000000..168fa11e --- /dev/null +++ b/scm/ztna_connector_all/api/tenant_api.py @@ -0,0 +1,1115 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.license_info import LicenseInfo +from scm.ztna_connector_all.models.start_tenant_offboarding202_response import StartTenantOffboarding202Response +from scm.ztna_connector_all.models.tenant_status import TenantStatus + +from scm.ztna_connector_all.api_client import ApiClient, RequestSerialized +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class TenantApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def get_license( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LicenseInfo: + """Get Tenant License Info + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_license_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LicenseInfo", + '401': "ErrorResponse", + '424': "ErrorResponse", + } + 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 + @with_error_handling + def get_license_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[LicenseInfo]: + """Get Tenant License Info + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_license_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LicenseInfo", + '401': "ErrorResponse", + '424': "ErrorResponse", + } + 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 + @with_error_handling + def get_license_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Tenant License Info + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_license_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LicenseInfo", + '401': "ErrorResponse", + '424': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_license_serialize( + self, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/license', + 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 + @with_error_handling + def get_tenant_status( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TenantStatus: + """Get Tenant Status + + Retrieves the current status of the tenant + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_status_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def get_tenant_status_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[TenantStatus]: + """Get Tenant Status + + Retrieves the current status of the tenant + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_status_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def get_tenant_status_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Tenant Status + + Retrieves the current status of the tenant + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_status_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TenantStatus", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_tenant_status_serialize( + self, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/tenant:status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + @with_error_handling + def start_tenant_offboarding( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StartTenantOffboarding202Response: + """Start Tenant Offboarding + + Initiates tenant deletion. This marks the tenant for deletion and triggers the cleanup process. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_offboarding_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "StartTenantOffboarding202Response", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def start_tenant_offboarding_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[StartTenantOffboarding202Response]: + """Start Tenant Offboarding + + Initiates tenant deletion. This marks the tenant for deletion and triggers the cleanup process. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_offboarding_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "StartTenantOffboarding202Response", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def start_tenant_offboarding_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Tenant Offboarding + + Initiates tenant deletion. This marks the tenant for deletion and triggers the cleanup process. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_offboarding_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "StartTenantOffboarding202Response", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _start_tenant_offboarding_serialize( + self, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/tenant:start-offboarding', + 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 + @with_error_handling + def start_tenant_onboarding( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Start Tenant Onboarding + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_onboarding_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "ErrorResponse", + } + 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 + @with_error_handling + def start_tenant_onboarding_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Start Tenant Onboarding + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_onboarding_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "ErrorResponse", + } + 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 + @with_error_handling + def start_tenant_onboarding_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Tenant Onboarding + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_tenant_onboarding_serialize( + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _start_tenant_onboarding_serialize( + self, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/tenant:start-onboarding', + 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/scm/ztna_connector_all/api/wildcard_api.py b/scm/ztna_connector_all/api/wildcard_api.py new file mode 100644 index 00000000..e9a55bbd --- /dev/null +++ b/scm/ztna_connector_all/api/wildcard_api.py @@ -0,0 +1,1895 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.wildcards import Wildcards +from scm.ztna_connector_all.models.wildcards_list_response import WildcardsListResponse + +from scm.ztna_connector_all.api_client import ApiClient, RequestSerialized +from scm.ztna_connector_all.api_response import ApiResponse +from scm.ztna_connector_all.rest import RESTResponseType +from scm.decorators import with_error_handling + + + +class WildcardApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + @with_error_handling + def create_wildcard( + self, + wildcards: Wildcards, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create Wildcard + + + :param wildcards: (required) + :type wildcards: Wildcards + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_serialize( + wildcards=wildcards, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_wildcard_with_http_info( + self, + wildcards: Wildcards, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Create Wildcard + + + :param wildcards: (required) + :type wildcards: Wildcards + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_serialize( + wildcards=wildcards, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def create_wildcard_without_preload_content( + self, + wildcards: Wildcards, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcard + + + :param wildcards: (required) + :type wildcards: Wildcards + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_serialize( + wildcards=wildcards, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_wildcard_serialize( + self, + wildcards, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if wildcards is not None: + _body_params = wildcards + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/sse/connector/v2.0/api/wildcards', + 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 + @with_error_handling + def delete_wildcard_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_wildcard_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def delete_wildcard_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_wildcard_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/sse/connector/v2.0/api/wildcards/{oid}', + 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 + @with_error_handling + def get_wildcard_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Wildcards: + """Get Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Wildcards", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_wildcard_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[Wildcards]: + """Get Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Wildcards", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + 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 + @with_error_handling + def get_wildcard_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Wildcards", + '400': "ErrorResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_wildcard_by_id_serialize( + self, + oid, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/wildcards/{oid}', + 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 + @with_error_handling + def list_wildcard_filters( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[str]: + """List Wildcard Filters + + Get filter values for wildcard fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_wildcard_filters_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[List[str]]: + """List Wildcard Filters + + Get filter values for wildcard fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_wildcard_filters_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + var_field: Annotated[Optional[StrictStr], Field(description="String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcard Filters + + Get filter values for wildcard fields. + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param var_field: String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. + :type var_field: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_filters_serialize( + x_panw_region=x_panw_region, + var_field=var_field, + search=search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[str]", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_wildcard_filters_serialize( + self, + x_panw_region, + var_field, + search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if var_field is not None: + + _query_params.append(('field', var_field)) + + if search is not None: + + _query_params.append(('search', search)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/wildcards/filters', + 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 + @with_error_handling + def list_wildcards( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WildcardsListResponse: + """List Wildcards + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcards_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WildcardsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_wildcards_with_http_info( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[WildcardsListResponse]: + """List Wildcards + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcards_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WildcardsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + 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 + @with_error_handling + def list_wildcards_without_preload_content( + self, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="A 0-based offset into the collection. It is the index of the starting entry of the page ")] = None, + limit: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="The max count in result entry (count per page)")] = None, + sort: Annotated[Optional[StrictStr], Field(description="List of fields from item response to sort by.")] = None, + search: Annotated[Optional[StrictStr], Field(description="String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified.")] = None, + filters: Annotated[Optional[StrictStr], Field(description="String to filter list results by searching one specified field of an object. Multiple filters can be specified.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcards + + + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param offset: A 0-based offset into the collection. It is the index of the starting entry of the page + :type offset: int + :param limit: The max count in result entry (count per page) + :type limit: int + :param sort: List of fields from item response to sort by. + :type sort: str + :param search: String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. + :type search: str + :param filters: String to filter list results by searching one specified field of an object. Multiple filters can be specified. + :type filters: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcards_serialize( + x_panw_region=x_panw_region, + offset=offset, + limit=limit, + sort=sort, + search=search, + filters=filters, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WildcardsListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_wildcards_serialize( + self, + x_panw_region, + offset, + limit, + sort, + search, + filters, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if offset is not None: + + _query_params.append(('offset', offset)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if search is not None: + + _query_params.append(('search', search)) + + if filters is not None: + + _query_params.append(('filters', filters)) + + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/sse/connector/v2.0/api/wildcards', + 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 + @with_error_handling + def update_wildcard_by_id( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + wildcards: Wildcards, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param wildcards: (required) + :type wildcards: Wildcards + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + wildcards=wildcards, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_wildcard_by_id_with_http_info( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + wildcards: Wildcards, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """Update Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param wildcards: (required) + :type wildcards: Wildcards + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + wildcards=wildcards, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + 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 + @with_error_handling + def update_wildcard_by_id_without_preload_content( + self, + oid: Annotated[StrictStr, Field(description="Object ID")], + wildcards: Wildcards, + x_panw_region: Annotated[Optional[StrictStr], Field(description="The region of the tenant")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Wildcard + + + :param oid: Object ID (required) + :type oid: str + :param wildcards: (required) + :type wildcards: Wildcards + :param x_panw_region: The region of the tenant + :type x_panw_region: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_wildcard_by_id_serialize( + oid=oid, + wildcards=wildcards, + x_panw_region=x_panw_region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_wildcard_by_id_serialize( + self, + oid, + wildcards, + x_panw_region, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if oid is not None: + _path_params['oid'] = oid + # process the query parameters + # process the header parameters + if x_panw_region is not None: + _header_params['x-panw-region'] = x_panw_region + # process the form parameters + # process the body parameter + if wildcards is not None: + _body_params = wildcards + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/sse/connector/v2.0/api/wildcards/{oid}', + 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/scm/ztna_connector_all/api_client.py b/scm/ztna_connector_all/api_client.py new file mode 100644 index 00000000..23a90d83 --- /dev/null +++ b/scm/ztna_connector_all/api_client.py @@ -0,0 +1,798 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from scm.ztna_connector_all.configuration import Configuration +from scm.ztna_connector_all.api_response import ApiResponse, T as ApiResponseT +import scm.ztna_connector_all.models +from scm.ztna_connector_all import rest +from scm.ztna_connector_all.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + + elif isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(scm.ztna_connector_all.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/scm/ztna_connector_all/api_response.py b/scm/ztna_connector_all/api_response.py new file mode 100644 index 00000000..9bc7c11f --- /dev/null +++ b/scm/ztna_connector_all/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/scm/ztna_connector_all/configuration.py b/scm/ztna_connector_all/configuration.py new file mode 100644 index 00000000..b65a69c9 --- /dev/null +++ b/scm/ztna_connector_all/configuration.py @@ -0,0 +1,460 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + 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 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + + :Example: + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + access_token=None, + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ignore_operation_servers=False, + ssl_ca_cert=None, + retries=None, + *, + debug: Optional[bool] = None + ) -> None: + """Constructor + """ + self._base_path = "https://api.sase.paloaltonetworks.com" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("scm.ztna_connector_all") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """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. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if self.access_token is not None: + auth['bearerAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: v2\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.sase.paloaltonetworks.com", + 'description': "ZTNA Connector API", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/scm/ztna_connector_all/docs/Applications.md b/scm/ztna_connector_all/docs/Applications.md new file mode 100644 index 00000000..02f52764 --- /dev/null +++ b/scm/ztna_connector_all/docs/Applications.md @@ -0,0 +1,39 @@ +# Applications + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**anycast_ip** | **str** | Anycast IP address assigned to this FQDN rule. | [optional] [readonly] +**app_enabled** | **bool** | Whether the FQDN rule is enabled. If omitted, defaults to false. | [optional] +**created_time** | **str** | | [optional] [readonly] +**description** | **str** | The description of the resource | [optional] +**group** | **str** | A comma separated list of connector group IDs | +**icmp_allowed** | **bool** | Whether ICMP is allowed for this FQDN rule. If omitted, defaults to true. | [optional] +**name** | **str** | Name of the FQDN rule. | +**oid** | **str** | The UUID of the resource | [optional] [readonly] +**spec** | [**List[ApplicationsSpecInner]**](ApplicationsSpecInner.md) | | +**updated_time** | **str** | | [optional] [readonly] +**use_dc_ip** | **bool** | Whether to use datacenter IP for this FQDN rule. If omitted, defaults to false. | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.applications import Applications + +# TODO update the JSON string below +json = "{}" +# create an instance of Applications from a JSON string +applications_instance = Applications.from_json(json) +# print the JSON string representation of the object +print(Applications.to_json()) + +# convert the object into a dict +applications_dict = applications_instance.to_dict() +# create an instance of Applications from a dict +applications_from_dict = Applications.from_dict(applications_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/scm/ztna_connector_all/docs/ApplicationsListResponse.md b/scm/ztna_connector_all/docs/ApplicationsListResponse.md new file mode 100644 index 00000000..d114492c --- /dev/null +++ b/scm/ztna_connector_all/docs/ApplicationsListResponse.md @@ -0,0 +1,32 @@ +# ApplicationsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[Applications]**](Applications.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.ztna_connector_all.models.applications_list_response import ApplicationsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ApplicationsListResponse from a JSON string +applications_list_response_instance = ApplicationsListResponse.from_json(json) +# print the JSON string representation of the object +print(ApplicationsListResponse.to_json()) + +# convert the object into a dict +applications_list_response_dict = applications_list_response_instance.to_dict() +# create an instance of ApplicationsListResponse from a dict +applications_list_response_from_dict = ApplicationsListResponse.from_dict(applications_list_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/scm/ztna_connector_all/docs/ApplicationsSpecInner.md b/scm/ztna_connector_all/docs/ApplicationsSpecInner.md new file mode 100644 index 00000000..3ef1054d --- /dev/null +++ b/scm/ztna_connector_all/docs/ApplicationsSpecInner.md @@ -0,0 +1,33 @@ +# ApplicationsSpecInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fqdn** | **str** | FQDN of the rule. | +**probe_port** | **str** | The probing port if the `probe_type` is `tcp_ping`. | [optional] +**probe_type** | **str** | The probing type. The value can be `tcp_ping`, `icmp_ping`, or omitted. | [optional] +**tcp_port** | **str** | TCP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443. | [optional] +**udp_port** | **str** | UDP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443. | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.applications_spec_inner import ApplicationsSpecInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ApplicationsSpecInner from a JSON string +applications_spec_inner_instance = ApplicationsSpecInner.from_json(json) +# print the JSON string representation of the object +print(ApplicationsSpecInner.to_json()) + +# convert the object into a dict +applications_spec_inner_dict = applications_spec_inner_instance.to_dict() +# create an instance of ApplicationsSpecInner from a dict +applications_spec_inner_from_dict = ApplicationsSpecInner.from_dict(applications_spec_inner_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/scm/ztna_connector_all/docs/ConnectorApi.md b/scm/ztna_connector_all/docs/ConnectorApi.md new file mode 100644 index 00000000..343f35ba --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorApi.md @@ -0,0 +1,1798 @@ +# scm.ztna_connector_all.ConnectorApi + +All URIs are relative to *https://api.sase.paloaltonetworks.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_connectors**](ConnectorApi.md#create_connectors) | **POST** /sse/connector/v2.0/api/connectors | Create Connector +[**create_connectors_pcaps_by_id**](ConnectorApi.md#create_connectors_pcaps_by_id) | **POST** /sse/connector/v2.0/api/connectors/{oid}/pcaps | Start Connector Packet Capture +[**create_connectors_scheduled_upgrade_by_id**](ConnectorApi.md#create_connectors_scheduled_upgrade_by_id) | **POST** /sse/connector/v2.0/api/connectors/{oid}/scheduled-upgrade | Create Connector Scheduled Upgrade +[**create_connectors_tech_support_files_by_id**](ConnectorApi.md#create_connectors_tech_support_files_by_id) | **POST** /sse/connector/v2.0/api/connectors/{oid}/tech-support-files | Start Connector Tech Support Generation +[**delete_connectors_by_id**](ConnectorApi.md#delete_connectors_by_id) | **DELETE** /sse/connector/v2.0/api/connectors/{oid} | Delete Connector +[**delete_connectors_scheduled_upgrade_by_id**](ConnectorApi.md#delete_connectors_scheduled_upgrade_by_id) | **DELETE** /sse/connector/v2.0/api/connectors/{oid}/scheduled-upgrade | Delete Connector Scheduled Upgrade +[**download_connectors_pcaps_by_id**](ConnectorApi.md#download_connectors_pcaps_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid}/pcaps/{id}:download | Download Connector Packet Capture File +[**download_connectors_tech_support_files_by_id**](ConnectorApi.md#download_connectors_tech_support_files_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid}/tech-support-files/{id}:download | Download Connector Tech Support File +[**get_connectors_by_id**](ConnectorApi.md#get_connectors_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid} | Get Connector +[**get_connectors_quiesce_by_id**](ConnectorApi.md#get_connectors_quiesce_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid}/quiesce | Get Connector Quiesce State +[**get_connectors_scheduled_upgrade_by_id**](ConnectorApi.md#get_connectors_scheduled_upgrade_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid}/scheduled-upgrade | Get Connector Scheduled Upgrade +[**get_connectors_scheduled_upgrade_status_by_id**](ConnectorApi.md#get_connectors_scheduled_upgrade_status_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid}/scheduled-upgrade-status | Get Connector Scheduled Upgrade Status +[**list_connector_filters**](ConnectorApi.md#list_connector_filters) | **GET** /sse/connector/v2.0/api/connectors/filters | List Connector Filters +[**list_connector_images**](ConnectorApi.md#list_connector_images) | **GET** /sse/connector/v2.0/api/connector-images | List Connector Image Versions +[**list_connectors**](ConnectorApi.md#list_connectors) | **GET** /sse/connector/v2.0/api/connectors | List Connectors +[**list_connectors_pcaps_by_id**](ConnectorApi.md#list_connectors_pcaps_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid}/pcaps | List Connector Packet Capture Files +[**list_connectors_tech_support_files_by_id**](ConnectorApi.md#list_connectors_tech_support_files_by_id) | **GET** /sse/connector/v2.0/api/connectors/{oid}/tech-support-files | List Connector Tech Support Files +[**stop_connectors_pcaps_by_id**](ConnectorApi.md#stop_connectors_pcaps_by_id) | **POST** /sse/connector/v2.0/api/connectors/{oid}/pcaps/{id}:stop | Stop Connector Packet Capture +[**stop_connectors_tech_support_files_by_id**](ConnectorApi.md#stop_connectors_tech_support_files_by_id) | **POST** /sse/connector/v2.0/api/connectors/{oid}/tech-support-files/{id}:stop | Stop Connector Tech Support Generation +[**update_connectors_by_id**](ConnectorApi.md#update_connectors_by_id) | **PUT** /sse/connector/v2.0/api/connectors/{oid} | Update Connector +[**update_connectors_quiesce_by_id**](ConnectorApi.md#update_connectors_quiesce_by_id) | **PUT** /sse/connector/v2.0/api/connectors/{oid}/quiesce | Update Connector Quiesce State +[**update_connectors_scheduled_upgrade_by_id**](ConnectorApi.md#update_connectors_scheduled_upgrade_by_id) | **PUT** /sse/connector/v2.0/api/connectors/{oid}/scheduled-upgrade | Update Connector Scheduled Upgrade + + +# **create_connectors** +> create_connectors(connectors, x_panw_region=x_panw_region) + +Create Connector + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connectors import Connectors +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + connectors = scm.ztna_connector_all.Connectors() # Connectors | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Create Connector + api_instance.create_connectors(connectors, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling ConnectorApi->create_connectors: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectors** | [**Connectors**](Connectors.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | + +[[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_connectors_pcaps_by_id** +> PacketCapture create_connectors_pcaps_by_id(oid, packet_capture_create) + +Start Connector Packet Capture + +This API will start a packet capture operation on the ZTNA connector. The Interface information must be provided in the API. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.packet_capture import PacketCapture +from scm.ztna_connector_all.models.packet_capture_create import PacketCaptureCreate +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + packet_capture_create = scm.ztna_connector_all.PacketCaptureCreate() # PacketCaptureCreate | + + try: + # Start Connector Packet Capture + api_response = api_instance.create_connectors_pcaps_by_id(oid, packet_capture_create) + print("The response of ConnectorApi->create_connectors_pcaps_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->create_connectors_pcaps_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **packet_capture_create** | [**PacketCaptureCreate**](PacketCaptureCreate.md)| | + +### Return type + +[**PacketCapture**](PacketCapture.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_scheduled_upgrade_by_id** +> create_connectors_scheduled_upgrade_by_id(oid, connector_scheduled_upgrade) + +Create Connector Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_scheduled_upgrade import ConnectorScheduledUpgrade +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + connector_scheduled_upgrade = scm.ztna_connector_all.ConnectorScheduledUpgrade() # ConnectorScheduledUpgrade | + + try: + # Create Connector Scheduled Upgrade + api_instance.create_connectors_scheduled_upgrade_by_id(oid, connector_scheduled_upgrade) + except Exception as e: + print("Exception when calling ConnectorApi->create_connectors_scheduled_upgrade_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **connector_scheduled_upgrade** | [**ConnectorScheduledUpgrade**](ConnectorScheduledUpgrade.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) | - | +**400** | Bad Request | - | +**404** | Not Found | - | + +[[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_connectors_tech_support_files_by_id** +> create_connectors_tech_support_files_by_id(oid) + +Start Connector Tech Support Generation + +This API will start a tech support operation on the ZTNA connector. In the current implementation it uses the \"dump tech-support\" command to generate the data. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + + try: + # Start Connector Tech Support Generation + api_instance.create_connectors_tech_support_files_by_id(oid) + except Exception as e: + print("Exception when calling ConnectorApi->create_connectors_tech_support_files_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_by_id** +> delete_connectors_by_id(oid, x_panw_region=x_panw_region) + +Delete Connector + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Delete Connector + api_instance.delete_connectors_by_id(oid, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling ConnectorApi->delete_connectors_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[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_connectors_scheduled_upgrade_by_id** +> delete_connectors_scheduled_upgrade_by_id(oid) + +Delete Connector Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + + try: + # Delete Connector Scheduled Upgrade + api_instance.delete_connectors_scheduled_upgrade_by_id(oid) + except Exception as e: + print("Exception when calling ConnectorApi->delete_connectors_scheduled_upgrade_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | + +[[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) + +# **download_connectors_pcaps_by_id** +> download_connectors_pcaps_by_id(oid, id) + +Download Connector Packet Capture File + +This API downloads the captured packet file from the ZTNA connector. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + id = 'id_example' # str | request id + + try: + # Download Connector Packet Capture File + api_instance.download_connectors_pcaps_by_id(oid, id) + except Exception as e: + print("Exception when calling ConnectorApi->download_connectors_pcaps_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **id** | **str**| request id | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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) + +# **download_connectors_tech_support_files_by_id** +> download_connectors_tech_support_files_by_id(oid, id) + +Download Connector Tech Support File + +This API downloads a tech support file from the ZTNA connector. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + id = 'id_example' # str | request id + + try: + # Download Connector Tech Support File + api_instance.download_connectors_tech_support_files_by_id(oid, id) + except Exception as e: + print("Exception when calling ConnectorApi->download_connectors_tech_support_files_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **id** | **str**| request id | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_by_id** +> Connectors get_connectors_by_id(oid, x_panw_region=x_panw_region) + +Get Connector + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connectors import Connectors +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Connector + api_response = api_instance.get_connectors_by_id(oid, x_panw_region=x_panw_region) + print("The response of ConnectorApi->get_connectors_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->get_connectors_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**Connectors**](Connectors.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connectors_quiesce_by_id** +> ConnectorQuiesce get_connectors_quiesce_by_id(oid, x_panw_region=x_panw_region) + +Get Connector Quiesce State + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_quiesce import ConnectorQuiesce +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Connector Quiesce State + api_response = api_instance.get_connectors_quiesce_by_id(oid, x_panw_region=x_panw_region) + print("The response of ConnectorApi->get_connectors_quiesce_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->get_connectors_quiesce_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**ConnectorQuiesce**](ConnectorQuiesce.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | +**424** | Failed Dependency | - | +**5XX** | Server Error | - | + +[[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_connectors_scheduled_upgrade_by_id** +> ConnectorScheduledUpgrade get_connectors_scheduled_upgrade_by_id(oid) + +Get Connector Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_scheduled_upgrade import ConnectorScheduledUpgrade +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + + try: + # Get Connector Scheduled Upgrade + api_response = api_instance.get_connectors_scheduled_upgrade_by_id(oid) + print("The response of ConnectorApi->get_connectors_scheduled_upgrade_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->get_connectors_scheduled_upgrade_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + +### Return type + +[**ConnectorScheduledUpgrade**](ConnectorScheduledUpgrade.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connectors_scheduled_upgrade_status_by_id** +> ConnectorUpgradeStatus get_connectors_scheduled_upgrade_status_by_id(oid, x_panw_region=x_panw_region) + +Get Connector Scheduled Upgrade Status + +Retrieves the detailed scheduled upgrade status for a specific connector + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_upgrade_status import ConnectorUpgradeStatus +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Connector Scheduled Upgrade Status + api_response = api_instance.get_connectors_scheduled_upgrade_status_by_id(oid, x_panw_region=x_panw_region) + print("The response of ConnectorApi->get_connectors_scheduled_upgrade_status_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->get_connectors_scheduled_upgrade_status_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**ConnectorUpgradeStatus**](ConnectorUpgradeStatus.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | +**5XX** | Server Error | - | + +[[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_connector_filters** +> List[str] list_connector_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + +List Connector Filters + +Get filter values for connector fields. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + var_field = 'connector_group' # str | String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + + try: + # List Connector Filters + api_response = api_instance.list_connector_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + print("The response of ConnectorApi->list_connector_filters:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->list_connector_filters: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **var_field** | **str**| String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + +### Return type + +**List[str]** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connector_images** +> List[str] list_connector_images() + +List Connector Image Versions + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + + try: + # List Connector Image Versions + api_response = api_instance.list_connector_images() + print("The response of ConnectorApi->list_connector_images:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->list_connector_images: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**List[str]** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors** +> ConnectorsListResponse list_connectors(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + +List Connectors + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connectors_list_response import ConnectorsListResponse +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + offset = 56 # int | A 0-based offset into the collection. It is the index of the starting entry of the page (optional) + limit = 56 # int | The max count in result entry (count per page) (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Connectors + api_response = api_instance.list_connectors(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + print("The response of ConnectorApi->list_connectors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->list_connectors: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **offset** | **int**| A 0-based offset into the collection. It is the index of the starting entry of the page | [optional] + **limit** | **int**| The max count in result entry (count per page) | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**ConnectorsListResponse**](ConnectorsListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_pcaps_by_id** +> DiagnosticFileList list_connectors_pcaps_by_id(oid) + +List Connector Packet Capture Files + +This API is used to get the list of captured packet files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.diagnostic_file_list import DiagnosticFileList +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + + try: + # List Connector Packet Capture Files + api_response = api_instance.list_connectors_pcaps_by_id(oid) + print("The response of ConnectorApi->list_connectors_pcaps_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->list_connectors_pcaps_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + +### Return type + +[**DiagnosticFileList**](DiagnosticFileList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_tech_support_files_by_id** +> DiagnosticFileList list_connectors_tech_support_files_by_id(oid) + +List Connector Tech Support Files + +This API is used to get the list the available \"dump tech-support\" data files on the ZTNA connector. The result is an array of file information objects. Each file information object has id, state, date, name and size of the file. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.diagnostic_file_list import DiagnosticFileList +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + + try: + # List Connector Tech Support Files + api_response = api_instance.list_connectors_tech_support_files_by_id(oid) + print("The response of ConnectorApi->list_connectors_tech_support_files_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->list_connectors_tech_support_files_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + +### Return type + +[**DiagnosticFileList**](DiagnosticFileList.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_pcaps_by_id** +> PacketCapture stop_connectors_pcaps_by_id(oid, id) + +Stop Connector Packet Capture + +This API will stop an in-progress packet capture operation on the ZTNA connector. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.packet_capture import PacketCapture +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + id = 'id_example' # str | request id + + try: + # Stop Connector Packet Capture + api_response = api_instance.stop_connectors_pcaps_by_id(oid, id) + print("The response of ConnectorApi->stop_connectors_pcaps_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorApi->stop_connectors_pcaps_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **id** | **str**| request id | + +### Return type + +[**PacketCapture**](PacketCapture.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_tech_support_files_by_id** +> stop_connectors_tech_support_files_by_id(oid, id) + +Stop Connector Tech Support Generation + +This API will stop an in-progress tech support operation on the ZTNA connector. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + id = 'id_example' # str | request id + + try: + # Stop Connector Tech Support Generation + api_instance.stop_connectors_tech_support_files_by_id(oid, id) + except Exception as e: + print("Exception when calling ConnectorApi->stop_connectors_tech_support_files_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **id** | **str**| request id | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connectors_by_id** +> update_connectors_by_id(oid, connectors, x_panw_region=x_panw_region) + +Update Connector + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connectors import Connectors +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + connectors = scm.ztna_connector_all.Connectors() # Connectors | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Update Connector + api_instance.update_connectors_by_id(oid, connectors, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling ConnectorApi->update_connectors_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **connectors** | [**Connectors**](Connectors.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[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_connectors_quiesce_by_id** +> update_connectors_quiesce_by_id(oid, connector_quiesce, x_panw_region=x_panw_region) + +Update Connector Quiesce State + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_quiesce import ConnectorQuiesce +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + connector_quiesce = scm.ztna_connector_all.ConnectorQuiesce() # ConnectorQuiesce | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Update Connector Quiesce State + api_instance.update_connectors_quiesce_by_id(oid, connector_quiesce, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling ConnectorApi->update_connectors_quiesce_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **connector_quiesce** | [**ConnectorQuiesce**](ConnectorQuiesce.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | [204 No Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) | - | +**400** | Bad Request | - | +**404** | Not Found | - | +**424** | Failed Dependency | - | +**5XX** | Server Error | - | + +[[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_connectors_scheduled_upgrade_by_id** +> update_connectors_scheduled_upgrade_by_id(oid, connector_scheduled_upgrade) + +Update Connector Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_scheduled_upgrade import ConnectorScheduledUpgrade +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorApi(api_client) + oid = 'oid_example' # str | Object ID + connector_scheduled_upgrade = scm.ztna_connector_all.ConnectorScheduledUpgrade() # ConnectorScheduledUpgrade | + + try: + # Update Connector Scheduled Upgrade + api_instance.update_connectors_scheduled_upgrade_by_id(oid, connector_scheduled_upgrade) + except Exception as e: + print("Exception when calling ConnectorApi->update_connectors_scheduled_upgrade_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **connector_scheduled_upgrade** | [**ConnectorScheduledUpgrade**](ConnectorScheduledUpgrade.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | [204 No Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) | - | +**400** | Bad Request | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/ztna_connector_all/docs/ConnectorGroupApi.md b/scm/ztna_connector_all/docs/ConnectorGroupApi.md new file mode 100644 index 00000000..5c74eaf0 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupApi.md @@ -0,0 +1,1261 @@ +# scm.ztna_connector_all.ConnectorGroupApi + +All URIs are relative to *https://api.sase.paloaltonetworks.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_connector_group**](ConnectorGroupApi.md#create_connector_group) | **POST** /sse/connector/v2.0/api/connector-groups | Create Connector Group +[**create_connector_group_scheduled_upgrade**](ConnectorGroupApi.md#create_connector_group_scheduled_upgrade) | **POST** /sse/connector/v2.0/api/connector-groups/{oid}/scheduled-upgrade | Create Connector Group Scheduled Upgrade +[**delete_connector_group_by_id**](ConnectorGroupApi.md#delete_connector_group_by_id) | **DELETE** /sse/connector/v2.0/api/connector-groups/{oid} | Delete Connector Group +[**delete_connector_group_scheduled_upgrade**](ConnectorGroupApi.md#delete_connector_group_scheduled_upgrade) | **DELETE** /sse/connector/v2.0/api/connector-groups/{oid}/scheduled-upgrade | Delete Connector Group Scheduled Upgrade +[**get_connector_group_by_id**](ConnectorGroupApi.md#get_connector_group_by_id) | **GET** /sse/connector/v2.0/api/connector-groups/{oid} | Get Connector Group +[**get_connector_group_scheduled_upgrade**](ConnectorGroupApi.md#get_connector_group_scheduled_upgrade) | **GET** /sse/connector/v2.0/api/connector-groups/{oid}/scheduled-upgrade | Get Connector Group Scheduled Upgrade +[**get_connector_group_scheduled_upgrade_status**](ConnectorGroupApi.md#get_connector_group_scheduled_upgrade_status) | **GET** /sse/connector/v2.0/api/connector-groups/{oid}/scheduled-upgrade-status | Get Connector Group Scheduled Upgrade Status +[**list_connector_group_applications**](ConnectorGroupApi.md#list_connector_group_applications) | **GET** /sse/connector/v2.0/api/connector-groups/{oid}/applications | List FQDNs per Connector Group +[**list_connector_group_connectors**](ConnectorGroupApi.md#list_connector_group_connectors) | **GET** /sse/connector/v2.0/api/connector-groups/{oid}/connectors | List Connectors per Connector Group +[**list_connector_group_filters**](ConnectorGroupApi.md#list_connector_group_filters) | **GET** /sse/connector/v2.0/api/connector-groups/filters | List Connector Group Filters +[**list_connector_group_subnets**](ConnectorGroupApi.md#list_connector_group_subnets) | **GET** /sse/connector/v2.0/api/connector-groups/{oid}/subnets | List Subnets per Connector Group +[**list_connector_group_wildcards**](ConnectorGroupApi.md#list_connector_group_wildcards) | **GET** /sse/connector/v2.0/api/connector-groups/{oid}/wildcards | List Wildcards per Connector Group +[**list_connector_groups**](ConnectorGroupApi.md#list_connector_groups) | **GET** /sse/connector/v2.0/api/connector-groups | List Connector Groups +[**update_connector_group_by_id**](ConnectorGroupApi.md#update_connector_group_by_id) | **PUT** /sse/connector/v2.0/api/connector-groups/{oid} | Update Connector Group +[**update_connector_group_scheduled_upgrade**](ConnectorGroupApi.md#update_connector_group_scheduled_upgrade) | **PUT** /sse/connector/v2.0/api/connector-groups/{oid}/scheduled-upgrade | Update Connector Group Scheduled Upgrade + + +# **create_connector_group** +> create_connector_group(connector_groups, x_panw_region=x_panw_region) + +Create Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + connector_groups = scm.ztna_connector_all.ConnectorGroups() # ConnectorGroups | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Create Connector Group + api_instance.create_connector_group(connector_groups, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling ConnectorGroupApi->create_connector_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connector_groups** | [**ConnectorGroups**](ConnectorGroups.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | + +[[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_connector_group_scheduled_upgrade** +> create_connector_group_scheduled_upgrade(oid, connector_group_scheduled_upgrade) + +Create Connector Group Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_scheduled_upgrade import ConnectorGroupScheduledUpgrade +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + connector_group_scheduled_upgrade = scm.ztna_connector_all.ConnectorGroupScheduledUpgrade() # ConnectorGroupScheduledUpgrade | + + try: + # Create Connector Group Scheduled Upgrade + api_instance.create_connector_group_scheduled_upgrade(oid, connector_group_scheduled_upgrade) + except Exception as e: + print("Exception when calling ConnectorGroupApi->create_connector_group_scheduled_upgrade: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **connector_group_scheduled_upgrade** | [**ConnectorGroupScheduledUpgrade**](ConnectorGroupScheduledUpgrade.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) | - | +**400** | Bad Request | - | +**404** | Not Found | - | + +[[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_connector_group_by_id** +> delete_connector_group_by_id(oid, x_panw_region=x_panw_region) + +Delete Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Delete Connector Group + api_instance.delete_connector_group_by_id(oid, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling ConnectorGroupApi->delete_connector_group_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[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_connector_group_scheduled_upgrade** +> delete_connector_group_scheduled_upgrade(oid) + +Delete Connector Group Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + + try: + # Delete Connector Group Scheduled Upgrade + api_instance.delete_connector_group_scheduled_upgrade(oid) + except Exception as e: + print("Exception when calling ConnectorGroupApi->delete_connector_group_scheduled_upgrade: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | + +[[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_connector_group_by_id** +> ConnectorGroups get_connector_group_by_id(oid, x_panw_region=x_panw_region) + +Get Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Connector Group + api_response = api_instance.get_connector_group_by_id(oid, x_panw_region=x_panw_region) + print("The response of ConnectorGroupApi->get_connector_group_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->get_connector_group_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**ConnectorGroups**](ConnectorGroups.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connector_group_scheduled_upgrade** +> ConnectorGroupScheduledUpgrade get_connector_group_scheduled_upgrade(oid) + +Get Connector Group Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_scheduled_upgrade import ConnectorGroupScheduledUpgrade +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + + try: + # Get Connector Group Scheduled Upgrade + api_response = api_instance.get_connector_group_scheduled_upgrade(oid) + print("The response of ConnectorGroupApi->get_connector_group_scheduled_upgrade:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->get_connector_group_scheduled_upgrade: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + +### Return type + +[**ConnectorGroupScheduledUpgrade**](ConnectorGroupScheduledUpgrade.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connector_group_scheduled_upgrade_status** +> ConnectorGroupUpgradeStatus get_connector_group_scheduled_upgrade_status(oid, x_panw_region=x_panw_region) + +Get Connector Group Scheduled Upgrade Status + +Retrieves the scheduled upgrade status for a connector group, including the upgrade status of all connectors in the group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_upgrade_status import ConnectorGroupUpgradeStatus +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Connector Group Scheduled Upgrade Status + api_response = api_instance.get_connector_group_scheduled_upgrade_status(oid, x_panw_region=x_panw_region) + print("The response of ConnectorGroupApi->get_connector_group_scheduled_upgrade_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->get_connector_group_scheduled_upgrade_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**ConnectorGroupUpgradeStatus**](ConnectorGroupUpgradeStatus.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connector_group_applications** +> ConnectorGroupFqdnRules list_connector_group_applications(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + +List FQDNs per Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_fqdn_rules import ConnectorGroupFqdnRules +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List FQDNs per Connector Group + api_response = api_instance.list_connector_group_applications(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + print("The response of ConnectorGroupApi->list_connector_group_applications:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->list_connector_group_applications: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**ConnectorGroupFqdnRules**](ConnectorGroupFqdnRules.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connector_group_connectors** +> ConnectorGroupConnectors list_connector_group_connectors(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + +List Connectors per Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_connectors import ConnectorGroupConnectors +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Connectors per Connector Group + api_response = api_instance.list_connector_group_connectors(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + print("The response of ConnectorGroupApi->list_connector_group_connectors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->list_connector_group_connectors: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**ConnectorGroupConnectors**](ConnectorGroupConnectors.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connector_group_filters** +> List[str] list_connector_group_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + +List Connector Group Filters + +Get filter values for connector group fields. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + var_field = 'connector_group' # str | String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + + try: + # List Connector Group Filters + api_response = api_instance.list_connector_group_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + print("The response of ConnectorGroupApi->list_connector_group_filters:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->list_connector_group_filters: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **var_field** | **str**| String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + +### Return type + +**List[str]** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connector_group_subnets** +> ConnectorGroupSubnetRules list_connector_group_subnets(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + +List Subnets per Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_subnet_rules import ConnectorGroupSubnetRules +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Subnets per Connector Group + api_response = api_instance.list_connector_group_subnets(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + print("The response of ConnectorGroupApi->list_connector_group_subnets:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->list_connector_group_subnets: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**ConnectorGroupSubnetRules**](ConnectorGroupSubnetRules.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connector_group_wildcards** +> ConnectorGroupWildcards list_connector_group_wildcards(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + +List Wildcards per Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_wildcards import ConnectorGroupWildcards +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Wildcards per Connector Group + api_response = api_instance.list_connector_group_wildcards(oid, x_panw_region=x_panw_region, sort=sort, search=search, filters=filters) + print("The response of ConnectorGroupApi->list_connector_group_wildcards:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->list_connector_group_wildcards: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**ConnectorGroupWildcards**](ConnectorGroupWildcards.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_connector_groups** +> ConnectorGroupsListResponse list_connector_groups(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + +List Connector Groups + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_groups_list_response import ConnectorGroupsListResponse +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + offset = 56 # int | A 0-based offset into the collection. It is the index of the starting entry of the page (optional) + limit = 56 # int | The max count in result entry (count per page) (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Connector Groups + api_response = api_instance.list_connector_groups(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + print("The response of ConnectorGroupApi->list_connector_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ConnectorGroupApi->list_connector_groups: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **offset** | **int**| A 0-based offset into the collection. It is the index of the starting entry of the page | [optional] + **limit** | **int**| The max count in result entry (count per page) | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**ConnectorGroupsListResponse**](ConnectorGroupsListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_connector_group_by_id** +> update_connector_group_by_id(oid, connector_groups, x_panw_region=x_panw_region) + +Update Connector Group + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + connector_groups = scm.ztna_connector_all.ConnectorGroups() # ConnectorGroups | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Update Connector Group + api_instance.update_connector_group_by_id(oid, connector_groups, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling ConnectorGroupApi->update_connector_group_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **connector_groups** | [**ConnectorGroups**](ConnectorGroups.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[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_connector_group_scheduled_upgrade** +> update_connector_group_scheduled_upgrade(oid, connector_group_scheduled_upgrade) + +Update Connector Group Scheduled Upgrade + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.connector_group_scheduled_upgrade import ConnectorGroupScheduledUpgrade +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.ConnectorGroupApi(api_client) + oid = 'oid_example' # str | Object ID + connector_group_scheduled_upgrade = scm.ztna_connector_all.ConnectorGroupScheduledUpgrade() # ConnectorGroupScheduledUpgrade | + + try: + # Update Connector Group Scheduled Upgrade + api_instance.update_connector_group_scheduled_upgrade(oid, connector_group_scheduled_upgrade) + except Exception as e: + print("Exception when calling ConnectorGroupApi->update_connector_group_scheduled_upgrade: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **connector_group_scheduled_upgrade** | [**ConnectorGroupScheduledUpgrade**](ConnectorGroupScheduledUpgrade.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | [204 No Content](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204) | - | +**400** | Bad Request | - | +**404** | Not Found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/ztna_connector_all/docs/ConnectorGroupConnectors.md b/scm/ztna_connector_all/docs/ConnectorGroupConnectors.md new file mode 100644 index 00000000..f6263c6e --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupConnectors.md @@ -0,0 +1,30 @@ +# ConnectorGroupConnectors + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connectors** | [**ConnectorGroupConnectorsConnectors**](ConnectorGroupConnectorsConnectors.md) | | [optional] +**group** | [**ConnectorGroups**](ConnectorGroups.md) | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_connectors import ConnectorGroupConnectors + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupConnectors from a JSON string +connector_group_connectors_instance = ConnectorGroupConnectors.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupConnectors.to_json()) + +# convert the object into a dict +connector_group_connectors_dict = connector_group_connectors_instance.to_dict() +# create an instance of ConnectorGroupConnectors from a dict +connector_group_connectors_from_dict = ConnectorGroupConnectors.from_dict(connector_group_connectors_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/scm/ztna_connector_all/docs/ConnectorGroupConnectorsConnectors.md b/scm/ztna_connector_all/docs/ConnectorGroupConnectorsConnectors.md new file mode 100644 index 00000000..917488dd --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupConnectorsConnectors.md @@ -0,0 +1,32 @@ +# ConnectorGroupConnectorsConnectors + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | [optional] +**limit** | **int** | | [optional] [default to 200] +**offset** | **int** | | [optional] [default to 0] +**total** | **int** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_connectors_connectors import ConnectorGroupConnectorsConnectors + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupConnectorsConnectors from a JSON string +connector_group_connectors_connectors_instance = ConnectorGroupConnectorsConnectors.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupConnectorsConnectors.to_json()) + +# convert the object into a dict +connector_group_connectors_connectors_dict = connector_group_connectors_connectors_instance.to_dict() +# create an instance of ConnectorGroupConnectorsConnectors from a dict +connector_group_connectors_connectors_from_dict = ConnectorGroupConnectorsConnectors.from_dict(connector_group_connectors_connectors_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/scm/ztna_connector_all/docs/ConnectorGroupFqdnRules.md b/scm/ztna_connector_all/docs/ConnectorGroupFqdnRules.md new file mode 100644 index 00000000..243cb72a --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupFqdnRules.md @@ -0,0 +1,30 @@ +# ConnectorGroupFqdnRules + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**applications** | [**ConnectorGroupConnectorsConnectors**](ConnectorGroupConnectorsConnectors.md) | | [optional] +**group** | [**ConnectorGroups**](ConnectorGroups.md) | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_fqdn_rules import ConnectorGroupFqdnRules + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupFqdnRules from a JSON string +connector_group_fqdn_rules_instance = ConnectorGroupFqdnRules.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupFqdnRules.to_json()) + +# convert the object into a dict +connector_group_fqdn_rules_dict = connector_group_fqdn_rules_instance.to_dict() +# create an instance of ConnectorGroupFqdnRules from a dict +connector_group_fqdn_rules_from_dict = ConnectorGroupFqdnRules.from_dict(connector_group_fqdn_rules_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/scm/ztna_connector_all/docs/ConnectorGroupScheduledUpgrade.md b/scm/ztna_connector_all/docs/ConnectorGroupScheduledUpgrade.md new file mode 100644 index 00000000..8c34253e --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupScheduledUpgrade.md @@ -0,0 +1,33 @@ +# ConnectorGroupScheduledUpgrade + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**drain_timeout** | **int** | Drain timeout in seconds for rolling upgrades. If omitted, defaults to 0. | [optional] +**image_id** | **str** | The connector image version ID to upgrade to. | +**rolling_upgrade** | **bool** | Whether to perform a rolling upgrade. If omitted, defaults to false. Requires SaasAgent version 6.1.0 or later. | [optional] +**scheduled_download** | **datetime** | The scheduled download time in RFC3339 format (UTC). If omitted, defaults to current UTC time. | [optional] +**scheduled_upgrade** | **datetime** | The scheduled upgrade time in RFC3339 format (UTC). Must be after the scheduled_download time. If omitted, defaults to current UTC time. | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_scheduled_upgrade import ConnectorGroupScheduledUpgrade + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupScheduledUpgrade from a JSON string +connector_group_scheduled_upgrade_instance = ConnectorGroupScheduledUpgrade.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupScheduledUpgrade.to_json()) + +# convert the object into a dict +connector_group_scheduled_upgrade_dict = connector_group_scheduled_upgrade_instance.to_dict() +# create an instance of ConnectorGroupScheduledUpgrade from a dict +connector_group_scheduled_upgrade_from_dict = ConnectorGroupScheduledUpgrade.from_dict(connector_group_scheduled_upgrade_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/scm/ztna_connector_all/docs/ConnectorGroupStatus.md b/scm/ztna_connector_all/docs/ConnectorGroupStatus.md new file mode 100644 index 00000000..35ee0157 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupStatus.md @@ -0,0 +1,36 @@ +# ConnectorGroupStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**anycast_ip** | **str** | | [optional] +**counts** | [**ConnectorGroupStatusCounts**](ConnectorGroupStatusCounts.md) | | [optional] +**pa_region** | **str** | | [optional] +**sw_version** | **str** | | [optional] +**token_active** | **str** | | [optional] +**token_secret** | **str** | | [optional] +**user_id_ip** | **str** | | [optional] +**user_id_port** | **str** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_status import ConnectorGroupStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupStatus from a JSON string +connector_group_status_instance = ConnectorGroupStatus.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupStatus.to_json()) + +# convert the object into a dict +connector_group_status_dict = connector_group_status_instance.to_dict() +# create an instance of ConnectorGroupStatus from a dict +connector_group_status_from_dict = ConnectorGroupStatus.from_dict(connector_group_status_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/scm/ztna_connector_all/docs/ConnectorGroupStatusCounts.md b/scm/ztna_connector_all/docs/ConnectorGroupStatusCounts.md new file mode 100644 index 00000000..9154acd0 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupStatusCounts.md @@ -0,0 +1,32 @@ +# ConnectorGroupStatusCounts + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**applications** | **int** | | [optional] +**connectors** | **int** | | [optional] +**ipsubnets** | **int** | | [optional] +**wildcards** | **int** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_status_counts import ConnectorGroupStatusCounts + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupStatusCounts from a JSON string +connector_group_status_counts_instance = ConnectorGroupStatusCounts.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupStatusCounts.to_json()) + +# convert the object into a dict +connector_group_status_counts_dict = connector_group_status_counts_instance.to_dict() +# create an instance of ConnectorGroupStatusCounts from a dict +connector_group_status_counts_from_dict = ConnectorGroupStatusCounts.from_dict(connector_group_status_counts_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/scm/ztna_connector_all/docs/ConnectorGroupSubnetRules.md b/scm/ztna_connector_all/docs/ConnectorGroupSubnetRules.md new file mode 100644 index 00000000..18cfcc34 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupSubnetRules.md @@ -0,0 +1,30 @@ +# ConnectorGroupSubnetRules + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | [**ConnectorGroups**](ConnectorGroups.md) | | [optional] +**subnets** | [**ConnectorGroupConnectorsConnectors**](ConnectorGroupConnectorsConnectors.md) | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_subnet_rules import ConnectorGroupSubnetRules + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupSubnetRules from a JSON string +connector_group_subnet_rules_instance = ConnectorGroupSubnetRules.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupSubnetRules.to_json()) + +# convert the object into a dict +connector_group_subnet_rules_dict = connector_group_subnet_rules_instance.to_dict() +# create an instance of ConnectorGroupSubnetRules from a dict +connector_group_subnet_rules_from_dict = ConnectorGroupSubnetRules.from_dict(connector_group_subnet_rules_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/scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatus.md b/scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatus.md new file mode 100644 index 00000000..a08fb803 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatus.md @@ -0,0 +1,33 @@ +# ConnectorGroupUpgradeStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ConnectorGroupUpgradeStatusDataInner]**](ConnectorGroupUpgradeStatusDataInner.md) | List of connector upgrade statuses within this group | [optional] +**name** | **str** | Connector group name | [optional] +**oid** | **str** | Connector group ID | [optional] +**rolling_upgrade** | **bool** | Whether rolling upgrade is enabled for this connector group | [optional] +**upgrade_status** | **str** | Overall upgrade status for the connector group | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_upgrade_status import ConnectorGroupUpgradeStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupUpgradeStatus from a JSON string +connector_group_upgrade_status_instance = ConnectorGroupUpgradeStatus.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupUpgradeStatus.to_json()) + +# convert the object into a dict +connector_group_upgrade_status_dict = connector_group_upgrade_status_instance.to_dict() +# create an instance of ConnectorGroupUpgradeStatus from a dict +connector_group_upgrade_status_from_dict = ConnectorGroupUpgradeStatus.from_dict(connector_group_upgrade_status_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/scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatusDataInner.md b/scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatusDataInner.md new file mode 100644 index 00000000..073bee82 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupUpgradeStatusDataInner.md @@ -0,0 +1,37 @@ +# ConnectorGroupUpgradeStatusDataInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**connector_name** | **str** | Connector name | [optional] +**connector_oid** | **str** | Connector ID | [optional] +**current_sw_version** | **str** | Current software version running on the connector | [optional] +**drain_time** | **int** | Time remaining until drain completes in seconds (present when connector is draining) | [optional] +**failure_reason** | **str** | Reason for upgrade failure (if upgrade failed) | [optional] +**sessions_count** | **int** | Number of active sessions (present when connector is draining) | [optional] +**upgrade_status** | **str** | Current upgrade status of the connector | [optional] +**upgrade_sw_version** | **str** | Target software version for the upgrade | [optional] +**upgrade_time** | **str** | Scheduled upgrade time | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_upgrade_status_data_inner import ConnectorGroupUpgradeStatusDataInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupUpgradeStatusDataInner from a JSON string +connector_group_upgrade_status_data_inner_instance = ConnectorGroupUpgradeStatusDataInner.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupUpgradeStatusDataInner.to_json()) + +# convert the object into a dict +connector_group_upgrade_status_data_inner_dict = connector_group_upgrade_status_data_inner_instance.to_dict() +# create an instance of ConnectorGroupUpgradeStatusDataInner from a dict +connector_group_upgrade_status_data_inner_from_dict = ConnectorGroupUpgradeStatusDataInner.from_dict(connector_group_upgrade_status_data_inner_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/scm/ztna_connector_all/docs/ConnectorGroupWildcards.md b/scm/ztna_connector_all/docs/ConnectorGroupWildcards.md new file mode 100644 index 00000000..c10ca3c1 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupWildcards.md @@ -0,0 +1,30 @@ +# ConnectorGroupWildcards + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | [**ConnectorGroups**](ConnectorGroups.md) | | [optional] +**wildcards** | [**ConnectorGroupConnectorsConnectors**](ConnectorGroupConnectorsConnectors.md) | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_group_wildcards import ConnectorGroupWildcards + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupWildcards from a JSON string +connector_group_wildcards_instance = ConnectorGroupWildcards.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupWildcards.to_json()) + +# convert the object into a dict +connector_group_wildcards_dict = connector_group_wildcards_instance.to_dict() +# create an instance of ConnectorGroupWildcards from a dict +connector_group_wildcards_from_dict = ConnectorGroupWildcards.from_dict(connector_group_wildcards_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/scm/ztna_connector_all/docs/ConnectorGroups.md b/scm/ztna_connector_all/docs/ConnectorGroups.md new file mode 100644 index 00000000..49388def --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroups.md @@ -0,0 +1,37 @@ +# ConnectorGroups + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_time** | **str** | | [optional] [readonly] +**description** | **str** | Description of the connector group. | [optional] +**is_autoscale** | **bool** | Whether the connector group is autoscaled. If omitted, defaults to false. | [optional] +**is_ngfw** | **bool** | Connector group type. If false (default), the group is a ZTNA Connector group. If true, the group is an NGFW Connector group. If omitted, defaults to false. | [optional] +**name** | **str** | Name of the connector group. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period. | +**oid** | **str** | Connector Group ID | [optional] [readonly] +**pba_project_name** | **str** | DPA project name that this connector group will serve. This field must be provided when the tenant is DPA-enabled, and must not be provided when the tenant is not DPA-enabled. | [optional] +**preserve_user_id** | **bool** | Whether to preserve user ID for this connector group. If omitted, defaults to false. | [optional] +**updated_time** | **str** | | [optional] [readonly] + +## Example + +```python +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroups from a JSON string +connector_groups_instance = ConnectorGroups.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroups.to_json()) + +# convert the object into a dict +connector_groups_dict = connector_groups_instance.to_dict() +# create an instance of ConnectorGroups from a dict +connector_groups_from_dict = ConnectorGroups.from_dict(connector_groups_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/scm/ztna_connector_all/docs/ConnectorGroupsListResponse.md b/scm/ztna_connector_all/docs/ConnectorGroupsListResponse.md new file mode 100644 index 00000000..bb67713b --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorGroupsListResponse.md @@ -0,0 +1,32 @@ +# ConnectorGroupsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[ConnectorGroups]**](ConnectorGroups.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.ztna_connector_all.models.connector_groups_list_response import ConnectorGroupsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorGroupsListResponse from a JSON string +connector_groups_list_response_instance = ConnectorGroupsListResponse.from_json(json) +# print the JSON string representation of the object +print(ConnectorGroupsListResponse.to_json()) + +# convert the object into a dict +connector_groups_list_response_dict = connector_groups_list_response_instance.to_dict() +# create an instance of ConnectorGroupsListResponse from a dict +connector_groups_list_response_from_dict = ConnectorGroupsListResponse.from_dict(connector_groups_list_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/scm/ztna_connector_all/docs/ConnectorQuiesce.md b/scm/ztna_connector_all/docs/ConnectorQuiesce.md new file mode 100644 index 00000000..2964ebe9 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorQuiesce.md @@ -0,0 +1,29 @@ +# ConnectorQuiesce + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | | + +## Example + +```python +from scm.ztna_connector_all.models.connector_quiesce import ConnectorQuiesce + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorQuiesce from a JSON string +connector_quiesce_instance = ConnectorQuiesce.from_json(json) +# print the JSON string representation of the object +print(ConnectorQuiesce.to_json()) + +# convert the object into a dict +connector_quiesce_dict = connector_quiesce_instance.to_dict() +# create an instance of ConnectorQuiesce from a dict +connector_quiesce_from_dict = ConnectorQuiesce.from_dict(connector_quiesce_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/scm/ztna_connector_all/docs/ConnectorScheduledUpgrade.md b/scm/ztna_connector_all/docs/ConnectorScheduledUpgrade.md new file mode 100644 index 00000000..072a9c70 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorScheduledUpgrade.md @@ -0,0 +1,31 @@ +# ConnectorScheduledUpgrade + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**image_id** | **str** | The connector image version ID to upgrade to. | +**scheduled_download** | **datetime** | The scheduled download time in RFC3339 format (UTC). If omitted, defaults to current UTC time. | [optional] +**scheduled_upgrade** | **datetime** | The scheduled upgrade time in RFC3339 format (UTC). Must be after the scheduled_download time. If omitted, defaults to current UTC time. | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_scheduled_upgrade import ConnectorScheduledUpgrade + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorScheduledUpgrade from a JSON string +connector_scheduled_upgrade_instance = ConnectorScheduledUpgrade.from_json(json) +# print the JSON string representation of the object +print(ConnectorScheduledUpgrade.to_json()) + +# convert the object into a dict +connector_scheduled_upgrade_dict = connector_scheduled_upgrade_instance.to_dict() +# create an instance of ConnectorScheduledUpgrade from a dict +connector_scheduled_upgrade_from_dict = ConnectorScheduledUpgrade.from_dict(connector_scheduled_upgrade_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/scm/ztna_connector_all/docs/ConnectorStatus.md b/scm/ztna_connector_all/docs/ConnectorStatus.md new file mode 100644 index 00000000..0b6b61c6 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorStatus.md @@ -0,0 +1,49 @@ +# ConnectorStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cgnx_location** | **str** | | [optional] +**cgnx_scheduled_download** | **str** | | [optional] +**cgnx_scheduled_sw_version** | **str** | | [optional] +**cgnx_scheduled_upgrade** | **str** | | [optional] +**cgnx_sw_version** | **str** | | [optional] +**cgnx_upgrade_description** | **str** | | [optional] +**cgnx_upgrade_download_percent** | **float** | | [optional] +**cgnx_upgrade_failure_info** | **str** | | [optional] +**cgnx_upgrade_retry_count** | **float** | | [optional] +**cgnx_upgrade_state** | **str** | When undefined, no upgrade is in progress. | [optional] +**cgnx_upgrade_status_last_updated** | **str** | | [optional] +**cgnx_vion_ip** | **str** | | [optional] +**cidr** | **str** | | [optional] +**error** | **object** | | [optional] +**flags** | [**ConnectorStatusFlags**](ConnectorStatusFlags.md) | | [optional] +**local_ip** | **str** | | [optional] +**sc_id** | **str** | Service Connection ID | [optional] +**sc_name** | **str** | | [optional] +**state_bits** | **float** | | [optional] +**token_active** | **str** | | [optional] +**token_secret** | **str** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_status import ConnectorStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorStatus from a JSON string +connector_status_instance = ConnectorStatus.from_json(json) +# print the JSON string representation of the object +print(ConnectorStatus.to_json()) + +# convert the object into a dict +connector_status_dict = connector_status_instance.to_dict() +# create an instance of ConnectorStatus from a dict +connector_status_from_dict = ConnectorStatus.from_dict(connector_status_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/scm/ztna_connector_all/docs/ConnectorStatusFlags.md b/scm/ztna_connector_all/docs/ConnectorStatusFlags.md new file mode 100644 index 00000000..3684c172 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorStatusFlags.md @@ -0,0 +1,33 @@ +# ConnectorStatusFlags + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capabilities** | [**ConnectorStatusFlagsCapabilities**](ConnectorStatusFlagsCapabilities.md) | | [optional] +**config_state** | **str** | | [optional] +**control_plane_up** | **bool** | | [optional] +**token_state** | **str** | | [optional] +**tunnel_up** | **bool** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_status_flags import ConnectorStatusFlags + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorStatusFlags from a JSON string +connector_status_flags_instance = ConnectorStatusFlags.from_json(json) +# print the JSON string representation of the object +print(ConnectorStatusFlags.to_json()) + +# convert the object into a dict +connector_status_flags_dict = connector_status_flags_instance.to_dict() +# create an instance of ConnectorStatusFlags from a dict +connector_status_flags_from_dict = ConnectorStatusFlags.from_dict(connector_status_flags_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/scm/ztna_connector_all/docs/ConnectorStatusFlagsCapabilities.md b/scm/ztna_connector_all/docs/ConnectorStatusFlagsCapabilities.md new file mode 100644 index 00000000..ee2aa186 --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorStatusFlagsCapabilities.md @@ -0,0 +1,30 @@ +# ConnectorStatusFlagsCapabilities + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ipsubnet_supported** | **bool** | | [optional] +**wildcard_supported** | **bool** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_status_flags_capabilities import ConnectorStatusFlagsCapabilities + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorStatusFlagsCapabilities from a JSON string +connector_status_flags_capabilities_instance = ConnectorStatusFlagsCapabilities.from_json(json) +# print the JSON string representation of the object +print(ConnectorStatusFlagsCapabilities.to_json()) + +# convert the object into a dict +connector_status_flags_capabilities_dict = connector_status_flags_capabilities_instance.to_dict() +# create an instance of ConnectorStatusFlagsCapabilities from a dict +connector_status_flags_capabilities_from_dict = ConnectorStatusFlagsCapabilities.from_dict(connector_status_flags_capabilities_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/scm/ztna_connector_all/docs/ConnectorUpgradeStatus.md b/scm/ztna_connector_all/docs/ConnectorUpgradeStatus.md new file mode 100644 index 00000000..661c0ccb --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorUpgradeStatus.md @@ -0,0 +1,38 @@ +# ConnectorUpgradeStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_image_id** | **str** | Currently active image ID | [optional] +**active_version** | **str** | Currently active software version | [optional] +**download_percent** | **int** | Download progress percentage | [optional] +**failure_info** | **str** | Failure information if upgrade failed | [optional] +**previous_image_id** | **str** | Previous image ID | [optional] +**scheduled_download** | **str** | Scheduled download time | [optional] +**scheduled_upgrade** | **str** | Scheduled upgrade time | [optional] +**upgrade_description** | **str** | Description of the upgrade | [optional] +**upgrade_image_id** | **str** | Target upgrade image ID | [optional] +**upgrade_state** | **str** | Current state of the upgrade process | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.connector_upgrade_status import ConnectorUpgradeStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorUpgradeStatus from a JSON string +connector_upgrade_status_instance = ConnectorUpgradeStatus.from_json(json) +# print the JSON string representation of the object +print(ConnectorUpgradeStatus.to_json()) + +# convert the object into a dict +connector_upgrade_status_dict = connector_upgrade_status_instance.to_dict() +# create an instance of ConnectorUpgradeStatus from a dict +connector_upgrade_status_from_dict = ConnectorUpgradeStatus.from_dict(connector_upgrade_status_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/scm/ztna_connector_all/docs/Connectors.md b/scm/ztna_connector_all/docs/Connectors.md new file mode 100644 index 00000000..33491c2d --- /dev/null +++ b/scm/ztna_connector_all/docs/Connectors.md @@ -0,0 +1,34 @@ +# Connectors + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_time** | **str** | | [optional] [readonly] +**description** | **str** | Description of the connector. | [optional] +**group** | **str** | The connector group id | +**name** | **str** | Name of the connector. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period. | +**oid** | **str** | Id of the entry. | [optional] [readonly] +**updated_time** | **str** | | [optional] [readonly] + +## Example + +```python +from scm.ztna_connector_all.models.connectors import Connectors + +# TODO update the JSON string below +json = "{}" +# create an instance of Connectors from a JSON string +connectors_instance = Connectors.from_json(json) +# print the JSON string representation of the object +print(Connectors.to_json()) + +# convert the object into a dict +connectors_dict = connectors_instance.to_dict() +# create an instance of Connectors from a dict +connectors_from_dict = Connectors.from_dict(connectors_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/scm/ztna_connector_all/docs/ConnectorsListResponse.md b/scm/ztna_connector_all/docs/ConnectorsListResponse.md new file mode 100644 index 00000000..9ff24c5f --- /dev/null +++ b/scm/ztna_connector_all/docs/ConnectorsListResponse.md @@ -0,0 +1,32 @@ +# ConnectorsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[Connectors]**](Connectors.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.ztna_connector_all.models.connectors_list_response import ConnectorsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ConnectorsListResponse from a JSON string +connectors_list_response_instance = ConnectorsListResponse.from_json(json) +# print the JSON string representation of the object +print(ConnectorsListResponse.to_json()) + +# convert the object into a dict +connectors_list_response_dict = connectors_list_response_instance.to_dict() +# create an instance of ConnectorsListResponse from a dict +connectors_list_response_from_dict = ConnectorsListResponse.from_dict(connectors_list_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/scm/ztna_connector_all/docs/DiagnosticFileList.md b/scm/ztna_connector_all/docs/DiagnosticFileList.md new file mode 100644 index 00000000..b33dd495 --- /dev/null +++ b/scm/ztna_connector_all/docs/DiagnosticFileList.md @@ -0,0 +1,29 @@ +# DiagnosticFileList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[DiagnosticFileListDataInner]**](DiagnosticFileListDataInner.md) | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.diagnostic_file_list import DiagnosticFileList + +# TODO update the JSON string below +json = "{}" +# create an instance of DiagnosticFileList from a JSON string +diagnostic_file_list_instance = DiagnosticFileList.from_json(json) +# print the JSON string representation of the object +print(DiagnosticFileList.to_json()) + +# convert the object into a dict +diagnostic_file_list_dict = diagnostic_file_list_instance.to_dict() +# create an instance of DiagnosticFileList from a dict +diagnostic_file_list_from_dict = DiagnosticFileList.from_dict(diagnostic_file_list_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/scm/ztna_connector_all/docs/DiagnosticFileListDataInner.md b/scm/ztna_connector_all/docs/DiagnosticFileListDataInner.md new file mode 100644 index 00000000..147cf335 --- /dev/null +++ b/scm/ztna_connector_all/docs/DiagnosticFileListDataInner.md @@ -0,0 +1,33 @@ +# DiagnosticFileListDataInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_date** | **str** | | [optional] +**filename** | **str** | Name of the file. | [optional] +**filesize** | **float** | Size of the file. | [optional] +**id** | **str** | Request id | [optional] +**state** | **str** | stopped, complete, inprogress | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.diagnostic_file_list_data_inner import DiagnosticFileListDataInner + +# TODO update the JSON string below +json = "{}" +# create an instance of DiagnosticFileListDataInner from a JSON string +diagnostic_file_list_data_inner_instance = DiagnosticFileListDataInner.from_json(json) +# print the JSON string representation of the object +print(DiagnosticFileListDataInner.to_json()) + +# convert the object into a dict +diagnostic_file_list_data_inner_dict = diagnostic_file_list_data_inner_instance.to_dict() +# create an instance of DiagnosticFileListDataInner from a dict +diagnostic_file_list_data_inner_from_dict = DiagnosticFileListDataInner.from_dict(diagnostic_file_list_data_inner_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/scm/ztna_connector_all/docs/DiscoveredApplicationApi.md b/scm/ztna_connector_all/docs/DiscoveredApplicationApi.md new file mode 100644 index 00000000..974d107e --- /dev/null +++ b/scm/ztna_connector_all/docs/DiscoveredApplicationApi.md @@ -0,0 +1,182 @@ +# scm.ztna_connector_all.DiscoveredApplicationApi + +All URIs are relative to *https://api.sase.paloaltonetworks.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_discovered_application_filters**](DiscoveredApplicationApi.md#list_discovered_application_filters) | **GET** /sse/connector/v2.0/api/discovered-applications/filters | List Discovered Application Filters +[**list_discovered_applications**](DiscoveredApplicationApi.md#list_discovered_applications) | **GET** /sse/connector/v2.0/api/discovered-applications | List Discovered Applications + + +# **list_discovered_application_filters** +> List[str] list_discovered_application_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + +List Discovered Application Filters + +Get filter values for discovered application fields. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.DiscoveredApplicationApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + var_field = 'connector_group' # str | String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + + try: + # List Discovered Application Filters + api_response = api_instance.list_discovered_application_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + print("The response of DiscoveredApplicationApi->list_discovered_application_filters:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscoveredApplicationApi->list_discovered_application_filters: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **var_field** | **str**| String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + +### Return type + +**List[str]** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_discovered_applications** +> DiscoveredApplicationsListResponse list_discovered_applications(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + +List Discovered Applications + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.discovered_applications_list_response import DiscoveredApplicationsListResponse +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.DiscoveredApplicationApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + offset = 56 # int | A 0-based offset into the collection. It is the index of the starting entry of the page (optional) + limit = 56 # int | The max count in result entry (count per page) (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Discovered Applications + api_response = api_instance.list_discovered_applications(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + print("The response of DiscoveredApplicationApi->list_discovered_applications:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling DiscoveredApplicationApi->list_discovered_applications: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **offset** | **int**| A 0-based offset into the collection. It is the index of the starting entry of the page | [optional] + **limit** | **int**| The max count in result entry (count per page) | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**DiscoveredApplicationsListResponse**](DiscoveredApplicationsListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) The request has been accepted for processing, but the processing has not been completed. The client should retry the request after the time specified in the Retry-After header. | * Retry-After - Indicates how long the client should wait before making a follow-up request
| +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/ztna_connector_all/docs/DiscoveredApplications.md b/scm/ztna_connector_all/docs/DiscoveredApplications.md new file mode 100644 index 00000000..fc543142 --- /dev/null +++ b/scm/ztna_connector_all/docs/DiscoveredApplications.md @@ -0,0 +1,32 @@ +# DiscoveredApplications + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**applications** | [**List[DiscoveredApplicationsApplicationsInner]**](DiscoveredApplicationsApplicationsInner.md) | | [optional] +**cie_tenant_id** | **str** | | [optional] +**count** | **float** | | [optional] +**tenant_id** | **str** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.discovered_applications import DiscoveredApplications + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscoveredApplications from a JSON string +discovered_applications_instance = DiscoveredApplications.from_json(json) +# print the JSON string representation of the object +print(DiscoveredApplications.to_json()) + +# convert the object into a dict +discovered_applications_dict = discovered_applications_instance.to_dict() +# create an instance of DiscoveredApplications from a dict +discovered_applications_from_dict = DiscoveredApplications.from_dict(discovered_applications_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/scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInner.md b/scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInner.md new file mode 100644 index 00000000..1317e4cd --- /dev/null +++ b/scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInner.md @@ -0,0 +1,35 @@ +# DiscoveredApplicationsApplicationsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_spec** | [**List[DiscoveredApplicationsApplicationsInnerAppSpecInner]**](DiscoveredApplicationsApplicationsInnerAppSpecInner.md) | | [optional] +**fqdn** | **str** | | [optional] +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**port** | **str** | | [optional] +**protocol** | **str** | | [optional] +**provider** | **str** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.discovered_applications_applications_inner import DiscoveredApplicationsApplicationsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscoveredApplicationsApplicationsInner from a JSON string +discovered_applications_applications_inner_instance = DiscoveredApplicationsApplicationsInner.from_json(json) +# print the JSON string representation of the object +print(DiscoveredApplicationsApplicationsInner.to_json()) + +# convert the object into a dict +discovered_applications_applications_inner_dict = discovered_applications_applications_inner_instance.to_dict() +# create an instance of DiscoveredApplicationsApplicationsInner from a dict +discovered_applications_applications_inner_from_dict = DiscoveredApplicationsApplicationsInner.from_dict(discovered_applications_applications_inner_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/scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInnerAppSpecInner.md b/scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInnerAppSpecInner.md new file mode 100644 index 00000000..b57f3d2c --- /dev/null +++ b/scm/ztna_connector_all/docs/DiscoveredApplicationsApplicationsInnerAppSpecInner.md @@ -0,0 +1,31 @@ +# DiscoveredApplicationsApplicationsInnerAppSpecInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fqdn** | **str** | | [optional] +**port** | **str** | | [optional] +**protocol** | **str** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.discovered_applications_applications_inner_app_spec_inner import DiscoveredApplicationsApplicationsInnerAppSpecInner + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscoveredApplicationsApplicationsInnerAppSpecInner from a JSON string +discovered_applications_applications_inner_app_spec_inner_instance = DiscoveredApplicationsApplicationsInnerAppSpecInner.from_json(json) +# print the JSON string representation of the object +print(DiscoveredApplicationsApplicationsInnerAppSpecInner.to_json()) + +# convert the object into a dict +discovered_applications_applications_inner_app_spec_inner_dict = discovered_applications_applications_inner_app_spec_inner_instance.to_dict() +# create an instance of DiscoveredApplicationsApplicationsInnerAppSpecInner from a dict +discovered_applications_applications_inner_app_spec_inner_from_dict = DiscoveredApplicationsApplicationsInnerAppSpecInner.from_dict(discovered_applications_applications_inner_app_spec_inner_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/scm/ztna_connector_all/docs/DiscoveredApplicationsListResponse.md b/scm/ztna_connector_all/docs/DiscoveredApplicationsListResponse.md new file mode 100644 index 00000000..7b718a70 --- /dev/null +++ b/scm/ztna_connector_all/docs/DiscoveredApplicationsListResponse.md @@ -0,0 +1,32 @@ +# DiscoveredApplicationsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[DiscoveredApplications]**](DiscoveredApplications.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.ztna_connector_all.models.discovered_applications_list_response import DiscoveredApplicationsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of DiscoveredApplicationsListResponse from a JSON string +discovered_applications_list_response_instance = DiscoveredApplicationsListResponse.from_json(json) +# print the JSON string representation of the object +print(DiscoveredApplicationsListResponse.to_json()) + +# convert the object into a dict +discovered_applications_list_response_dict = discovered_applications_list_response_instance.to_dict() +# create an instance of DiscoveredApplicationsListResponse from a dict +discovered_applications_list_response_from_dict = DiscoveredApplicationsListResponse.from_dict(discovered_applications_list_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/scm/ztna_connector_all/docs/ErrorDetail.md b/scm/ztna_connector_all/docs/ErrorDetail.md new file mode 100644 index 00000000..a6ca33b2 --- /dev/null +++ b/scm/ztna_connector_all/docs/ErrorDetail.md @@ -0,0 +1,32 @@ +# ErrorDetail + +Error detail information following Google Cloud API CauseInfo format + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Type identifier for the detail object | [optional] +**causes** | [**List[ErrorDetailCausesInner]**](ErrorDetailCausesInner.md) | Array of cause information objects | [optional] +**message** | **str** | Detailed error message | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.error_detail import ErrorDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorDetail from a JSON string +error_detail_instance = ErrorDetail.from_json(json) +# print the JSON string representation of the object +print(ErrorDetail.to_json()) + +# convert the object into a dict +error_detail_dict = error_detail_instance.to_dict() +# create an instance of ErrorDetail from a dict +error_detail_from_dict = ErrorDetail.from_dict(error_detail_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/scm/ztna_connector_all/docs/ErrorDetailCausesInner.md b/scm/ztna_connector_all/docs/ErrorDetailCausesInner.md new file mode 100644 index 00000000..1fda86e4 --- /dev/null +++ b/scm/ztna_connector_all/docs/ErrorDetailCausesInner.md @@ -0,0 +1,30 @@ +# ErrorDetailCausesInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | Cause message | [optional] +**module** | **str** | Module where the cause originated | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.error_detail_causes_inner import ErrorDetailCausesInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorDetailCausesInner from a JSON string +error_detail_causes_inner_instance = ErrorDetailCausesInner.from_json(json) +# print the JSON string representation of the object +print(ErrorDetailCausesInner.to_json()) + +# convert the object into a dict +error_detail_causes_inner_dict = error_detail_causes_inner_instance.to_dict() +# create an instance of ErrorDetailCausesInner from a dict +error_detail_causes_inner_from_dict = ErrorDetailCausesInner.from_dict(error_detail_causes_inner_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/scm/ztna_connector_all/docs/ErrorObject.md b/scm/ztna_connector_all/docs/ErrorObject.md new file mode 100644 index 00000000..4990df52 --- /dev/null +++ b/scm/ztna_connector_all/docs/ErrorObject.md @@ -0,0 +1,32 @@ +# ErrorObject + +Error object following Google Cloud API error format + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code | [optional] +**details** | [**List[ErrorDetail]**](ErrorDetail.md) | Additional error details | [optional] +**message** | **str** | Human-readable error message | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.error_object import ErrorObject + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorObject from a JSON string +error_object_instance = ErrorObject.from_json(json) +# print the JSON string representation of the object +print(ErrorObject.to_json()) + +# convert the object into a dict +error_object_dict = error_object_instance.to_dict() +# create an instance of ErrorObject from a dict +error_object_from_dict = ErrorObject.from_dict(error_object_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/scm/ztna_connector_all/docs/ErrorResponse.md b/scm/ztna_connector_all/docs/ErrorResponse.md new file mode 100644 index 00000000..095f98f6 --- /dev/null +++ b/scm/ztna_connector_all/docs/ErrorResponse.md @@ -0,0 +1,30 @@ +# ErrorResponse + +Error response payload + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**ErrorObject**](ErrorObject.md) | | + +## Example + +```python +from scm.ztna_connector_all.models.error_response import ErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorResponse from a JSON string +error_response_instance = ErrorResponse.from_json(json) +# print the JSON string representation of the object +print(ErrorResponse.to_json()) + +# convert the object into a dict +error_response_dict = error_response_instance.to_dict() +# create an instance of ErrorResponse from a dict +error_response_from_dict = ErrorResponse.from_dict(error_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/scm/ztna_connector_all/docs/FQDNApi.md b/scm/ztna_connector_all/docs/FQDNApi.md new file mode 100644 index 00000000..8707dc4f --- /dev/null +++ b/scm/ztna_connector_all/docs/FQDNApi.md @@ -0,0 +1,509 @@ +# scm.ztna_connector_all.FQDNApi + +All URIs are relative to *https://api.sase.paloaltonetworks.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_applications**](FQDNApi.md#create_applications) | **POST** /sse/connector/v2.0/api/applications | Create FQDN +[**delete_applications_by_id**](FQDNApi.md#delete_applications_by_id) | **DELETE** /sse/connector/v2.0/api/applications/{oid} | Delete FQDN +[**get_applications_by_id**](FQDNApi.md#get_applications_by_id) | **GET** /sse/connector/v2.0/api/applications/{oid} | Get FQDN +[**list_application_filters**](FQDNApi.md#list_application_filters) | **GET** /sse/connector/v2.0/api/applications/filters | List FQDN Filters +[**list_applications**](FQDNApi.md#list_applications) | **GET** /sse/connector/v2.0/api/applications | List FQDNs +[**update_applications_by_id**](FQDNApi.md#update_applications_by_id) | **PUT** /sse/connector/v2.0/api/applications/{oid} | Update FQDN + + +# **create_applications** +> create_applications(applications, x_panw_region=x_panw_region) + +Create FQDN + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.applications import Applications +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.FQDNApi(api_client) + applications = scm.ztna_connector_all.Applications() # Applications | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Create FQDN + api_instance.create_applications(applications, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling FQDNApi->create_applications: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **applications** | [**Applications**](Applications.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | + +[[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_applications_by_id** +> delete_applications_by_id(oid, x_panw_region=x_panw_region) + +Delete FQDN + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.FQDNApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Delete FQDN + api_instance.delete_applications_by_id(oid, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling FQDNApi->delete_applications_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[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_applications_by_id** +> Applications get_applications_by_id(oid, x_panw_region=x_panw_region) + +Get FQDN + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.applications import Applications +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.FQDNApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get FQDN + api_response = api_instance.get_applications_by_id(oid, x_panw_region=x_panw_region) + print("The response of FQDNApi->get_applications_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FQDNApi->get_applications_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**Applications**](Applications.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_application_filters** +> List[str] list_application_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + +List FQDN Filters + +Get filter values for FQDN rule fields. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.FQDNApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + var_field = 'connector_group' # str | String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + + try: + # List FQDN Filters + api_response = api_instance.list_application_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + print("The response of FQDNApi->list_application_filters:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FQDNApi->list_application_filters: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **var_field** | **str**| String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + +### Return type + +**List[str]** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_applications** +> ApplicationsListResponse list_applications(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + +List FQDNs + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.applications_list_response import ApplicationsListResponse +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.FQDNApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + offset = 56 # int | A 0-based offset into the collection. It is the index of the starting entry of the page (optional) + limit = 56 # int | The max count in result entry (count per page) (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List FQDNs + api_response = api_instance.list_applications(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + print("The response of FQDNApi->list_applications:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FQDNApi->list_applications: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **offset** | **int**| A 0-based offset into the collection. It is the index of the starting entry of the page | [optional] + **limit** | **int**| The max count in result entry (count per page) | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**ApplicationsListResponse**](ApplicationsListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_applications_by_id** +> update_applications_by_id(oid, applications, x_panw_region=x_panw_region) + +Update FQDN + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.applications import Applications +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.FQDNApi(api_client) + oid = 'oid_example' # str | Object ID + applications = scm.ztna_connector_all.Applications() # Applications | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Update FQDN + api_instance.update_applications_by_id(oid, applications, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling FQDNApi->update_applications_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **applications** | [**Applications**](Applications.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/ztna_connector_all/docs/LicenseInfo.md b/scm/ztna_connector_all/docs/LicenseInfo.md new file mode 100644 index 00000000..9d7367ce --- /dev/null +++ b/scm/ztna_connector_all/docs/LicenseInfo.md @@ -0,0 +1,34 @@ +# LicenseInfo + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**applications** | **float** | | [optional] +**connectors** | **float** | | [optional] +**expiry** | **datetime** | | [optional] +**license_name** | **str** | | [optional] +**max_applications** | **float** | | [optional] +**max_connectors** | **float** | | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.license_info import LicenseInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of LicenseInfo from a JSON string +license_info_instance = LicenseInfo.from_json(json) +# print the JSON string representation of the object +print(LicenseInfo.to_json()) + +# convert the object into a dict +license_info_dict = license_info_instance.to_dict() +# create an instance of LicenseInfo from a dict +license_info_from_dict = LicenseInfo.from_dict(license_info_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/scm/ztna_connector_all/docs/PacketCapture.md b/scm/ztna_connector_all/docs/PacketCapture.md new file mode 100644 index 00000000..9e196ad0 --- /dev/null +++ b/scm/ztna_connector_all/docs/PacketCapture.md @@ -0,0 +1,31 @@ +# PacketCapture + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Request id generated by the micro-service, and is used on other API calls | [optional] +**message** | **float** | Return code description | [optional] +**status** | **str** | Return code (CDBG_ERROR or CDBG_OK) | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.packet_capture import PacketCapture + +# TODO update the JSON string below +json = "{}" +# create an instance of PacketCapture from a JSON string +packet_capture_instance = PacketCapture.from_json(json) +# print the JSON string representation of the object +print(PacketCapture.to_json()) + +# convert the object into a dict +packet_capture_dict = packet_capture_instance.to_dict() +# create an instance of PacketCapture from a dict +packet_capture_from_dict = PacketCapture.from_dict(packet_capture_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/scm/ztna_connector_all/docs/PacketCaptureCreate.md b/scm/ztna_connector_all/docs/PacketCaptureCreate.md new file mode 100644 index 00000000..717e8583 --- /dev/null +++ b/scm/ztna_connector_all/docs/PacketCaptureCreate.md @@ -0,0 +1,32 @@ +# PacketCaptureCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**host** | **str** | IPv4 address | [optional] +**interface** | **str** | Following are the acceptable labels - internal, external, tunnel | +**port** | **str** | Port number | [optional] +**protocol** | **str** | Following are the acceptable labels - TCP, UDP, ICMP, ARP | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.packet_capture_create import PacketCaptureCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of PacketCaptureCreate from a JSON string +packet_capture_create_instance = PacketCaptureCreate.from_json(json) +# print the JSON string representation of the object +print(PacketCaptureCreate.to_json()) + +# convert the object into a dict +packet_capture_create_dict = packet_capture_create_instance.to_dict() +# create an instance of PacketCaptureCreate from a dict +packet_capture_create_from_dict = PacketCaptureCreate.from_dict(packet_capture_create_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/scm/ztna_connector_all/docs/StartTenantOffboarding202Response.md b/scm/ztna_connector_all/docs/StartTenantOffboarding202Response.md new file mode 100644 index 00000000..7d423f84 --- /dev/null +++ b/scm/ztna_connector_all/docs/StartTenantOffboarding202Response.md @@ -0,0 +1,29 @@ +# StartTenantOffboarding202Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**msg** | **str** | Confirmation message | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.start_tenant_offboarding202_response import StartTenantOffboarding202Response + +# TODO update the JSON string below +json = "{}" +# create an instance of StartTenantOffboarding202Response from a JSON string +start_tenant_offboarding202_response_instance = StartTenantOffboarding202Response.from_json(json) +# print the JSON string representation of the object +print(StartTenantOffboarding202Response.to_json()) + +# convert the object into a dict +start_tenant_offboarding202_response_dict = start_tenant_offboarding202_response_instance.to_dict() +# create an instance of StartTenantOffboarding202Response from a dict +start_tenant_offboarding202_response_from_dict = StartTenantOffboarding202Response.from_dict(start_tenant_offboarding202_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/scm/ztna_connector_all/docs/SubnetApi.md b/scm/ztna_connector_all/docs/SubnetApi.md new file mode 100644 index 00000000..48aa8ab3 --- /dev/null +++ b/scm/ztna_connector_all/docs/SubnetApi.md @@ -0,0 +1,509 @@ +# scm.ztna_connector_all.SubnetApi + +All URIs are relative to *https://api.sase.paloaltonetworks.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_subnet**](SubnetApi.md#create_subnet) | **POST** /sse/connector/v2.0/api/subnets | Create Subnet +[**delete_subnet_by_id**](SubnetApi.md#delete_subnet_by_id) | **DELETE** /sse/connector/v2.0/api/subnets/{oid} | Delete Subnet +[**get_subnet_by_id**](SubnetApi.md#get_subnet_by_id) | **GET** /sse/connector/v2.0/api/subnets/{oid} | Get Subnet +[**list_subnet_filters**](SubnetApi.md#list_subnet_filters) | **GET** /sse/connector/v2.0/api/subnets/filters | List Subnet Filters +[**list_subnets**](SubnetApi.md#list_subnets) | **GET** /sse/connector/v2.0/api/subnets | List Subnets +[**update_subnet_by_id**](SubnetApi.md#update_subnet_by_id) | **PUT** /sse/connector/v2.0/api/subnets/{oid} | Update Subnet + + +# **create_subnet** +> create_subnet(subnets, x_panw_region=x_panw_region) + +Create Subnet + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.subnets import Subnets +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.SubnetApi(api_client) + subnets = scm.ztna_connector_all.Subnets() # Subnets | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Create Subnet + api_instance.create_subnet(subnets, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling SubnetApi->create_subnet: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subnets** | [**Subnets**](Subnets.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | + +[[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_subnet_by_id** +> delete_subnet_by_id(oid, x_panw_region=x_panw_region) + +Delete Subnet + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.SubnetApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Delete Subnet + api_instance.delete_subnet_by_id(oid, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling SubnetApi->delete_subnet_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[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_subnet_by_id** +> Subnets get_subnet_by_id(oid, x_panw_region=x_panw_region) + +Get Subnet + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.subnets import Subnets +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.SubnetApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Subnet + api_response = api_instance.get_subnet_by_id(oid, x_panw_region=x_panw_region) + print("The response of SubnetApi->get_subnet_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SubnetApi->get_subnet_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**Subnets**](Subnets.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_subnet_filters** +> List[str] list_subnet_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + +List Subnet Filters + +Get filter values for subnet rule fields. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.SubnetApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + var_field = 'connector_group' # str | String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + + try: + # List Subnet Filters + api_response = api_instance.list_subnet_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + print("The response of SubnetApi->list_subnet_filters:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SubnetApi->list_subnet_filters: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **var_field** | **str**| String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + +### Return type + +**List[str]** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_subnets** +> SubnetsListResponse list_subnets(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + +List Subnets + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.subnets_list_response import SubnetsListResponse +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.SubnetApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + offset = 56 # int | A 0-based offset into the collection. It is the index of the starting entry of the page (optional) + limit = 56 # int | The max count in result entry (count per page) (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Subnets + api_response = api_instance.list_subnets(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + print("The response of SubnetApi->list_subnets:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SubnetApi->list_subnets: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **offset** | **int**| A 0-based offset into the collection. It is the index of the starting entry of the page | [optional] + **limit** | **int**| The max count in result entry (count per page) | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**SubnetsListResponse**](SubnetsListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_subnet_by_id** +> update_subnet_by_id(oid, subnets, x_panw_region=x_panw_region) + +Update Subnet + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.subnets import Subnets +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.SubnetApi(api_client) + oid = 'oid_example' # str | Object ID + subnets = scm.ztna_connector_all.Subnets() # Subnets | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Update Subnet + api_instance.update_subnet_by_id(oid, subnets, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling SubnetApi->update_subnet_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **subnets** | [**Subnets**](Subnets.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/ztna_connector_all/docs/Subnets.md b/scm/ztna_connector_all/docs/Subnets.md new file mode 100644 index 00000000..6659ebd2 --- /dev/null +++ b/scm/ztna_connector_all/docs/Subnets.md @@ -0,0 +1,37 @@ +# Subnets + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_enabled** | **bool** | Whether the IP subnet rule is enabled. If omitted, defaults to false. | [optional] +**created_time** | **str** | | [optional] [readonly] +**description** | **str** | | [optional] +**group** | **str** | A comma separated list of connector group IDs | +**icmp_allowed** | **bool** | Whether ICMP is allowed for this IP subnet rule. If omitted, defaults to true. | [optional] +**ip_subnets** | **str** | IPv4 subnet in CIDR notation (x.x.x.x/y) | +**name** | **str** | Name of the IP Subnet rule. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period. | +**oid** | **str** | Id of the entry. | [optional] [readonly] +**updated_time** | **str** | | [optional] [readonly] + +## Example + +```python +from scm.ztna_connector_all.models.subnets import Subnets + +# TODO update the JSON string below +json = "{}" +# create an instance of Subnets from a JSON string +subnets_instance = Subnets.from_json(json) +# print the JSON string representation of the object +print(Subnets.to_json()) + +# convert the object into a dict +subnets_dict = subnets_instance.to_dict() +# create an instance of Subnets from a dict +subnets_from_dict = Subnets.from_dict(subnets_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/scm/ztna_connector_all/docs/SubnetsListResponse.md b/scm/ztna_connector_all/docs/SubnetsListResponse.md new file mode 100644 index 00000000..b7244cc7 --- /dev/null +++ b/scm/ztna_connector_all/docs/SubnetsListResponse.md @@ -0,0 +1,32 @@ +# SubnetsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[Subnets]**](Subnets.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.ztna_connector_all.models.subnets_list_response import SubnetsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SubnetsListResponse from a JSON string +subnets_list_response_instance = SubnetsListResponse.from_json(json) +# print the JSON string representation of the object +print(SubnetsListResponse.to_json()) + +# convert the object into a dict +subnets_list_response_dict = subnets_list_response_instance.to_dict() +# create an instance of SubnetsListResponse from a dict +subnets_list_response_from_dict = SubnetsListResponse.from_dict(subnets_list_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/scm/ztna_connector_all/docs/TenantApi.md b/scm/ztna_connector_all/docs/TenantApi.md new file mode 100644 index 00000000..b5c0302a --- /dev/null +++ b/scm/ztna_connector_all/docs/TenantApi.md @@ -0,0 +1,324 @@ +# scm.ztna_connector_all.TenantApi + +All URIs are relative to *https://api.sase.paloaltonetworks.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_license**](TenantApi.md#get_license) | **GET** /sse/connector/v2.0/api/license | Get Tenant License Info +[**get_tenant_status**](TenantApi.md#get_tenant_status) | **GET** /sse/connector/v2.0/api/tenant:status | Get Tenant Status +[**start_tenant_offboarding**](TenantApi.md#start_tenant_offboarding) | **POST** /sse/connector/v2.0/api/tenant:start-offboarding | Start Tenant Offboarding +[**start_tenant_onboarding**](TenantApi.md#start_tenant_onboarding) | **POST** /sse/connector/v2.0/api/tenant:start-onboarding | Start Tenant Onboarding + + +# **get_license** +> LicenseInfo get_license(x_panw_region=x_panw_region) + +Get Tenant License Info + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.license_info import LicenseInfo +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.TenantApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Tenant License Info + api_response = api_instance.get_license(x_panw_region=x_panw_region) + print("The response of TenantApi->get_license:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TenantApi->get_license: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**LicenseInfo**](LicenseInfo.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**424** | Failed Dependency | - | + +[[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_tenant_status** +> TenantStatus get_tenant_status(x_panw_region=x_panw_region) + +Get Tenant Status + +Retrieves the current status of the tenant + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.tenant_status import TenantStatus +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.TenantApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Tenant Status + api_response = api_instance.get_tenant_status(x_panw_region=x_panw_region) + print("The response of TenantApi->get_tenant_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TenantApi->get_tenant_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**TenantStatus**](TenantStatus.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_tenant_offboarding** +> StartTenantOffboarding202Response start_tenant_offboarding(x_panw_region=x_panw_region) + +Start Tenant Offboarding + +Initiates tenant deletion. This marks the tenant for deletion and triggers the cleanup process. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.start_tenant_offboarding202_response import StartTenantOffboarding202Response +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.TenantApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Start Tenant Offboarding + api_response = api_instance.start_tenant_offboarding(x_panw_region=x_panw_region) + print("The response of TenantApi->start_tenant_offboarding:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TenantApi->start_tenant_offboarding: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**StartTenantOffboarding202Response**](StartTenantOffboarding202Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Accepted | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_tenant_onboarding** +> start_tenant_onboarding(x_panw_region=x_panw_region) + +Start Tenant Onboarding + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.TenantApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Start Tenant Onboarding + api_instance.start_tenant_onboarding(x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling TenantApi->start_tenant_onboarding: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**401** | Unauthorized | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/ztna_connector_all/docs/TenantStatus.md b/scm/ztna_connector_all/docs/TenantStatus.md new file mode 100644 index 00000000..86a58b00 --- /dev/null +++ b/scm/ztna_connector_all/docs/TenantStatus.md @@ -0,0 +1,29 @@ +# TenantStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | Tenant status | + +## Example + +```python +from scm.ztna_connector_all.models.tenant_status import TenantStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of TenantStatus from a JSON string +tenant_status_instance = TenantStatus.from_json(json) +# print the JSON string representation of the object +print(TenantStatus.to_json()) + +# convert the object into a dict +tenant_status_dict = tenant_status_instance.to_dict() +# create an instance of TenantStatus from a dict +tenant_status_from_dict = TenantStatus.from_dict(tenant_status_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/scm/ztna_connector_all/docs/WildcardApi.md b/scm/ztna_connector_all/docs/WildcardApi.md new file mode 100644 index 00000000..bf6a21e0 --- /dev/null +++ b/scm/ztna_connector_all/docs/WildcardApi.md @@ -0,0 +1,509 @@ +# scm.ztna_connector_all.WildcardApi + +All URIs are relative to *https://api.sase.paloaltonetworks.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_wildcard**](WildcardApi.md#create_wildcard) | **POST** /sse/connector/v2.0/api/wildcards | Create Wildcard +[**delete_wildcard_by_id**](WildcardApi.md#delete_wildcard_by_id) | **DELETE** /sse/connector/v2.0/api/wildcards/{oid} | Delete Wildcard +[**get_wildcard_by_id**](WildcardApi.md#get_wildcard_by_id) | **GET** /sse/connector/v2.0/api/wildcards/{oid} | Get Wildcard +[**list_wildcard_filters**](WildcardApi.md#list_wildcard_filters) | **GET** /sse/connector/v2.0/api/wildcards/filters | List Wildcard Filters +[**list_wildcards**](WildcardApi.md#list_wildcards) | **GET** /sse/connector/v2.0/api/wildcards | List Wildcards +[**update_wildcard_by_id**](WildcardApi.md#update_wildcard_by_id) | **PUT** /sse/connector/v2.0/api/wildcards/{oid} | Update Wildcard + + +# **create_wildcard** +> create_wildcard(wildcards, x_panw_region=x_panw_region) + +Create Wildcard + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.wildcards import Wildcards +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.WildcardApi(api_client) + wildcards = scm.ztna_connector_all.Wildcards() # Wildcards | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Create Wildcard + api_instance.create_wildcard(wildcards, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling WildcardApi->create_wildcard: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **wildcards** | [**Wildcards**](Wildcards.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | [201 Created](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**409** | Conflict | - | + +[[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_wildcard_by_id** +> delete_wildcard_by_id(oid, x_panw_region=x_panw_region) + +Delete Wildcard + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.WildcardApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Delete Wildcard + api_instance.delete_wildcard_by_id(oid, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling WildcardApi->delete_wildcard_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | [202 Accepted](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[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_wildcard_by_id** +> Wildcards get_wildcard_by_id(oid, x_panw_region=x_panw_region) + +Get Wildcard + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.wildcards import Wildcards +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.WildcardApi(api_client) + oid = 'oid_example' # str | Object ID + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Get Wildcard + api_response = api_instance.get_wildcard_by_id(oid, x_panw_region=x_panw_region) + print("The response of WildcardApi->get_wildcard_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WildcardApi->get_wildcard_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +[**Wildcards**](Wildcards.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**404** | Not Found | - | + +[[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_wildcard_filters** +> List[str] list_wildcard_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + +List Wildcard Filters + +Get filter values for wildcard fields. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.WildcardApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + var_field = 'connector_group' # str | String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + + try: + # List Wildcard Filters + api_response = api_instance.list_wildcard_filters(x_panw_region=x_panw_region, var_field=var_field, search=search) + print("The response of WildcardApi->list_wildcard_filters:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WildcardApi->list_wildcard_filters: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **var_field** | **str**| String that represents a static filter field. Call any of the /filters endpoints without specifying a field to get a list of all available fields. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + +### Return type + +**List[str]** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_wildcards** +> WildcardsListResponse list_wildcards(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + +List Wildcards + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.wildcards_list_response import WildcardsListResponse +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.WildcardApi(api_client) + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + offset = 56 # int | A 0-based offset into the collection. It is the index of the starting entry of the page (optional) + limit = 56 # int | The max count in result entry (count per page) (optional) + sort = 'A[asc],B[desc],C' # str | List of fields from item response to sort by. (optional) + search = 'connector1' # str | String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. (optional) + filters = '{\"field\":\"name\",\"search\":\"abc\"}' # str | String to filter list results by searching one specified field of an object. Multiple filters can be specified. (optional) + + try: + # List Wildcards + api_response = api_instance.list_wildcards(x_panw_region=x_panw_region, offset=offset, limit=limit, sort=sort, search=search, filters=filters) + print("The response of WildcardApi->list_wildcards:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WildcardApi->list_wildcards: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_panw_region** | **str**| The region of the tenant | [optional] + **offset** | **int**| A 0-based offset into the collection. It is the index of the starting entry of the page | [optional] + **limit** | **int**| The max count in result entry (count per page) | [optional] + **sort** | **str**| List of fields from item response to sort by. | [optional] + **search** | **str**| String to filter list results by. Is searched over multiple fields in each object. Multiple searches can be specified. | [optional] + **filters** | **str**| String to filter list results by searching one specified field of an object. Multiple filters can be specified. | [optional] + +### Return type + +[**WildcardsListResponse**](WildcardsListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | + +[[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_wildcard_by_id** +> update_wildcard_by_id(oid, wildcards, x_panw_region=x_panw_region) + +Update Wildcard + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import scm.ztna_connector_all +from scm.ztna_connector_all.models.wildcards import Wildcards +from scm.ztna_connector_all.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sase.paloaltonetworks.com +# See configuration.py for a list of all supported configuration parameters. +configuration = scm.ztna_connector_all.Configuration( + host = "https://api.sase.paloaltonetworks.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = scm.ztna_connector_all.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with scm.ztna_connector_all.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = scm.ztna_connector_all.WildcardApi(api_client) + oid = 'oid_example' # str | Object ID + wildcards = scm.ztna_connector_all.Wildcards() # Wildcards | + x_panw_region = 'x_panw_region_example' # str | The region of the tenant (optional) + + try: + # Update Wildcard + api_instance.update_wildcard_by_id(oid, wildcards, x_panw_region=x_panw_region) + except Exception as e: + print("Exception when calling WildcardApi->update_wildcard_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **oid** | **str**| Object ID | + **wildcards** | [**Wildcards**](Wildcards.md)| | + **x_panw_region** | **str**| The region of the tenant | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | [200 OK](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200) | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not Found | - | +**409** | Conflict | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/scm/ztna_connector_all/docs/Wildcards.md b/scm/ztna_connector_all/docs/Wildcards.md new file mode 100644 index 00000000..45863d40 --- /dev/null +++ b/scm/ztna_connector_all/docs/Wildcards.md @@ -0,0 +1,45 @@ +# Wildcards + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_enabled** | **bool** | Whether the wildcard is enabled. If omitted, defaults to false. | [optional] +**applications** | **object** | Discovered Wildcard App oid to name mapping. | [optional] [readonly] +**created_time** | **str** | | [optional] [readonly] +**description** | **str** | | [optional] +**enable_policy** | **bool** | Whether policy is enabled for this wildcard. If omitted, defaults to false. | [optional] +**fqdn** | **str** | The wildcard to match. | +**group** | **str** | A comma separated list of connector group IDs | +**icmp_allowed** | **bool** | Whether ICMP is allowed for this wildcard. If omitted, defaults to true. | [optional] +**id** | **str** | Id of the entry as returned by list/get operations. | [optional] [readonly] +**name** | **str** | Name of the wildcard. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period. | +**oid** | **str** | Id of the entry. | [optional] [readonly] +**probe_port** | **str** | The probing port if the `probe_type` is `tcp_ping`. | [optional] +**probe_type** | **str** | The probing type. The value can be `tcp_ping`, `icmp_ping`, or omitted. | [optional] +**tcp_port** | **str** | TCP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443. | [optional] +**udp_port** | **str** | UDP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443. | [optional] +**updated_time** | **str** | | [optional] [readonly] +**use_dc_ip** | **bool** | Whether to use datacenter IP for this wildcard. If omitted, defaults to false. | [optional] + +## Example + +```python +from scm.ztna_connector_all.models.wildcards import Wildcards + +# TODO update the JSON string below +json = "{}" +# create an instance of Wildcards from a JSON string +wildcards_instance = Wildcards.from_json(json) +# print the JSON string representation of the object +print(Wildcards.to_json()) + +# convert the object into a dict +wildcards_dict = wildcards_instance.to_dict() +# create an instance of Wildcards from a dict +wildcards_from_dict = Wildcards.from_dict(wildcards_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/scm/ztna_connector_all/docs/WildcardsListResponse.md b/scm/ztna_connector_all/docs/WildcardsListResponse.md new file mode 100644 index 00000000..be041320 --- /dev/null +++ b/scm/ztna_connector_all/docs/WildcardsListResponse.md @@ -0,0 +1,32 @@ +# WildcardsListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[Wildcards]**](Wildcards.md) | | +**limit** | **int** | The maximum number of results per page | [default to 200] +**offset** | **int** | The offset into the list of results returned | [default to 0] +**total** | **int** | The total count of results | + +## Example + +```python +from scm.ztna_connector_all.models.wildcards_list_response import WildcardsListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WildcardsListResponse from a JSON string +wildcards_list_response_instance = WildcardsListResponse.from_json(json) +# print the JSON string representation of the object +print(WildcardsListResponse.to_json()) + +# convert the object into a dict +wildcards_list_response_dict = wildcards_list_response_instance.to_dict() +# create an instance of WildcardsListResponse from a dict +wildcards_list_response_from_dict = WildcardsListResponse.from_dict(wildcards_list_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/scm/ztna_connector_all/exceptions.py b/scm/ztna_connector_all/exceptions.py new file mode 100644 index 00000000..ac5ad024 --- /dev/null +++ b/scm/ztna_connector_all/exceptions.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/scm/ztna_connector_all/models/__init__.py b/scm/ztna_connector_all/models/__init__.py new file mode 100644 index 00000000..a861fefc --- /dev/null +++ b/scm/ztna_connector_all/models/__init__.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +# flake8: noqa +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from scm.ztna_connector_all.models.applications import Applications +from scm.ztna_connector_all.models.applications_list_response import ApplicationsListResponse +from scm.ztna_connector_all.models.applications_spec_inner import ApplicationsSpecInner +from scm.ztna_connector_all.models.connector_group_connectors import ConnectorGroupConnectors +from scm.ztna_connector_all.models.connector_group_connectors_connectors import ConnectorGroupConnectorsConnectors +from scm.ztna_connector_all.models.connector_group_fqdn_rules import ConnectorGroupFqdnRules +from scm.ztna_connector_all.models.connector_group_scheduled_upgrade import ConnectorGroupScheduledUpgrade +from scm.ztna_connector_all.models.connector_group_status import ConnectorGroupStatus +from scm.ztna_connector_all.models.connector_group_status_counts import ConnectorGroupStatusCounts +from scm.ztna_connector_all.models.connector_group_subnet_rules import ConnectorGroupSubnetRules +from scm.ztna_connector_all.models.connector_group_upgrade_status import ConnectorGroupUpgradeStatus +from scm.ztna_connector_all.models.connector_group_upgrade_status_data_inner import ConnectorGroupUpgradeStatusDataInner +from scm.ztna_connector_all.models.connector_group_wildcards import ConnectorGroupWildcards +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from scm.ztna_connector_all.models.connector_groups_list_response import ConnectorGroupsListResponse +from scm.ztna_connector_all.models.connector_quiesce import ConnectorQuiesce +from scm.ztna_connector_all.models.connector_scheduled_upgrade import ConnectorScheduledUpgrade +from scm.ztna_connector_all.models.connector_status import ConnectorStatus +from scm.ztna_connector_all.models.connector_status_flags import ConnectorStatusFlags +from scm.ztna_connector_all.models.connector_status_flags_capabilities import ConnectorStatusFlagsCapabilities +from scm.ztna_connector_all.models.connector_upgrade_status import ConnectorUpgradeStatus +from scm.ztna_connector_all.models.connectors import Connectors +from scm.ztna_connector_all.models.connectors_list_response import ConnectorsListResponse +from scm.ztna_connector_all.models.diagnostic_file_list import DiagnosticFileList +from scm.ztna_connector_all.models.diagnostic_file_list_data_inner import DiagnosticFileListDataInner +from scm.ztna_connector_all.models.discovered_applications import DiscoveredApplications +from scm.ztna_connector_all.models.discovered_applications_applications_inner import DiscoveredApplicationsApplicationsInner +from scm.ztna_connector_all.models.discovered_applications_applications_inner_app_spec_inner import DiscoveredApplicationsApplicationsInnerAppSpecInner +from scm.ztna_connector_all.models.discovered_applications_list_response import DiscoveredApplicationsListResponse +from scm.ztna_connector_all.models.error_detail import ErrorDetail +from scm.ztna_connector_all.models.error_detail_causes_inner import ErrorDetailCausesInner +from scm.ztna_connector_all.models.error_object import ErrorObject +from scm.ztna_connector_all.models.error_response import ErrorResponse +from scm.ztna_connector_all.models.license_info import LicenseInfo +from scm.ztna_connector_all.models.packet_capture import PacketCapture +from scm.ztna_connector_all.models.packet_capture_create import PacketCaptureCreate +from scm.ztna_connector_all.models.start_tenant_offboarding202_response import StartTenantOffboarding202Response +from scm.ztna_connector_all.models.subnets import Subnets +from scm.ztna_connector_all.models.subnets_list_response import SubnetsListResponse +from scm.ztna_connector_all.models.tenant_status import TenantStatus +from scm.ztna_connector_all.models.wildcards import Wildcards +from scm.ztna_connector_all.models.wildcards_list_response import WildcardsListResponse diff --git a/scm/ztna_connector_all/models/applications.py b/scm/ztna_connector_all/models/applications.py new file mode 100644 index 00000000..366ade9e --- /dev/null +++ b/scm/ztna_connector_all/models/applications.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from typing_extensions import Annotated +from scm.ztna_connector_all.models.applications_spec_inner import ApplicationsSpecInner +from typing import Optional, Set +from typing_extensions import Self + +class Applications(BaseModel): + """ + Applications + """ # noqa: E501 + anycast_ip: Optional[StrictStr] = Field(default=None, description="Anycast IP address assigned to this FQDN rule.") + app_enabled: Optional[StrictBool] = Field(default=None, description="Whether the FQDN rule is enabled. If omitted, defaults to false.") + created_time: Optional[StrictStr] = None + description: Optional[Annotated[str, Field(strict=True, max_length=1023)]] = Field(default=None, description="The description of the resource") + group: StrictStr = Field(description="A comma separated list of connector group IDs") + icmp_allowed: Optional[StrictBool] = Field(default=None, description="Whether ICMP is allowed for this FQDN rule. If omitted, defaults to true.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=63)] = Field(description="Name of the FQDN rule.") + oid: Optional[StrictStr] = Field(default=None, description="The UUID of the resource") + spec: List[ApplicationsSpecInner] + updated_time: Optional[StrictStr] = None + use_dc_ip: Optional[StrictBool] = Field(default=None, description="Whether to use datacenter IP for this FQDN rule. If omitted, defaults to false.") + __properties: ClassVar[List[str]] = ["anycast_ip", "app_enabled", "created_time", "description", "group", "icmp_allowed", "name", "oid", "spec", "updated_time", "use_dc_ip"] + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[a-zA-Z\d\-_\. ]+$", value): + raise ValueError(r"must validate the regular expression /^[a-zA-Z\d\-_\. ]+$/") + 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 Applications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "anycast_ip", + "created_time", + "oid", + "updated_time", + ]) + + _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 spec (list) + _items = [] + if self.spec: + for _item_spec in self.spec: + if _item_spec: + _items.append(_item_spec.to_dict()) + _dict['spec'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Applications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "anycast_ip": obj.get("anycast_ip"), + "app_enabled": obj.get("app_enabled"), + "created_time": obj.get("created_time"), + "description": obj.get("description"), + "group": obj.get("group"), + "icmp_allowed": obj.get("icmp_allowed"), + "name": obj.get("name"), + "oid": obj.get("oid"), + "spec": [ApplicationsSpecInner.from_dict(_item) for _item in obj["spec"]] if obj.get("spec") is not None else None, + "updated_time": obj.get("updated_time"), + "use_dc_ip": obj.get("use_dc_ip") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/applications_list_response.py b/scm/ztna_connector_all/models/applications_list_response.py new file mode 100644 index 00000000..a16d7ddc --- /dev/null +++ b/scm/ztna_connector_all/models/applications_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.applications import Applications +from typing import Optional, Set +from typing_extensions import Self + +class ApplicationsListResponse(BaseModel): + """ + ApplicationsListResponse + """ # noqa: E501 + data: List[Applications] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApplicationsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApplicationsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = Applications.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [Applications.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/applications_spec_inner.py b/scm/ztna_connector_all/models/applications_spec_inner.py new file mode 100644 index 00000000..94395e91 --- /dev/null +++ b/scm/ztna_connector_all/models/applications_spec_inner.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ApplicationsSpecInner(BaseModel): + """ + ApplicationsSpecInner + """ # noqa: E501 + fqdn: Annotated[str, Field(strict=True)] = Field(description="FQDN of the rule.") + probe_port: Optional[StrictStr] = Field(default=None, description="The probing port if the `probe_type` is `tcp_ping`.") + probe_type: Optional[StrictStr] = Field(default=None, description="The probing type. The value can be `tcp_ping`, `icmp_ping`, or omitted.") + tcp_port: Optional[StrictStr] = Field(default=None, description="TCP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443.") + udp_port: Optional[StrictStr] = Field(default=None, description="UDP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443.") + __properties: ClassVar[List[str]] = ["fqdn", "probe_port", "probe_type", "tcp_port", "udp_port"] + + @field_validator('fqdn') + def fqdn_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$", value): + raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/") + return value + + @field_validator('probe_type') + def probe_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['tcp_ping', 'icmp_ping']): + raise ValueError("must be one of enum values ('tcp_ping', 'icmp_ping')") + 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 ApplicationsSpecInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ApplicationsSpecInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fqdn": obj.get("fqdn"), + "probe_port": obj.get("probe_port"), + "probe_type": obj.get("probe_type"), + "tcp_port": obj.get("tcp_port"), + "udp_port": obj.get("udp_port") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_connectors.py b/scm/ztna_connector_all/models/connector_group_connectors.py new file mode 100644 index 00000000..88f8d762 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_connectors.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from scm.ztna_connector_all.models.connector_group_connectors_connectors import ConnectorGroupConnectorsConnectors +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupConnectors(BaseModel): + """ + ConnectorGroupConnectors + """ # noqa: E501 + connectors: Optional[ConnectorGroupConnectorsConnectors] = None + group: Optional[ConnectorGroups] = None + __properties: ClassVar[List[str]] = ["connectors", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupConnectors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 connectors + if self.connectors: + _dict['connectors'] = self.connectors.to_dict() + # override the default output from pydantic by calling `to_dict()` of group + if self.group: + _dict['group'] = self.group.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupConnectors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "connectors": ConnectorGroupConnectorsConnectors.from_dict(obj["connectors"]) if obj.get("connectors") is not None else None, + "group": ConnectorGroups.from_dict(obj["group"]) if obj.get("group") is not None else None + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_connectors_connectors.py b/scm/ztna_connector_all/models/connector_group_connectors_connectors.py new file mode 100644 index 00000000..27f9110b --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_connectors_connectors.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupConnectorsConnectors(BaseModel): + """ + ConnectorGroupConnectorsConnectors + """ # noqa: E501 + data: Optional[Any] = None + limit: Optional[StrictInt] = 200 + offset: Optional[StrictInt] = 0 + total: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupConnectorsConnectors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupConnectorsConnectors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": obj.get("data"), + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_fqdn_rules.py b/scm/ztna_connector_all/models/connector_group_fqdn_rules.py new file mode 100644 index 00000000..33c3e893 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_fqdn_rules.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from scm.ztna_connector_all.models.connector_group_connectors_connectors import ConnectorGroupConnectorsConnectors +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupFqdnRules(BaseModel): + """ + ConnectorGroupFqdnRules + """ # noqa: E501 + applications: Optional[ConnectorGroupConnectorsConnectors] = None + group: Optional[ConnectorGroups] = None + __properties: ClassVar[List[str]] = ["applications", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupFqdnRules from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 applications + if self.applications: + _dict['applications'] = self.applications.to_dict() + # override the default output from pydantic by calling `to_dict()` of group + if self.group: + _dict['group'] = self.group.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupFqdnRules from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applications": ConnectorGroupConnectorsConnectors.from_dict(obj["applications"]) if obj.get("applications") is not None else None, + "group": ConnectorGroups.from_dict(obj["group"]) if obj.get("group") is not None else None + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_scheduled_upgrade.py b/scm/ztna_connector_all/models/connector_group_scheduled_upgrade.py new file mode 100644 index 00000000..1de7c698 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_scheduled_upgrade.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupScheduledUpgrade(BaseModel): + """ + ConnectorGroupScheduledUpgrade + """ # noqa: E501 + drain_timeout: Optional[StrictInt] = Field(default=None, description="Drain timeout in seconds for rolling upgrades. If omitted, defaults to 0.") + image_id: StrictStr = Field(description="The connector image version ID to upgrade to.") + rolling_upgrade: Optional[StrictBool] = Field(default=None, description="Whether to perform a rolling upgrade. If omitted, defaults to false. Requires SaasAgent version 6.1.0 or later.") + scheduled_download: Optional[datetime] = Field(default=None, description="The scheduled download time in RFC3339 format (UTC). If omitted, defaults to current UTC time.") + scheduled_upgrade: Optional[datetime] = Field(default=None, description="The scheduled upgrade time in RFC3339 format (UTC). Must be after the scheduled_download time. If omitted, defaults to current UTC time.") + __properties: ClassVar[List[str]] = ["drain_timeout", "image_id", "rolling_upgrade", "scheduled_download", "scheduled_upgrade"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupScheduledUpgrade from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ConnectorGroupScheduledUpgrade from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "drain_timeout": obj.get("drain_timeout"), + "image_id": obj.get("image_id"), + "rolling_upgrade": obj.get("rolling_upgrade"), + "scheduled_download": obj.get("scheduled_download"), + "scheduled_upgrade": obj.get("scheduled_upgrade") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_status.py b/scm/ztna_connector_all/models/connector_group_status.py new file mode 100644 index 00000000..14eb3363 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_status.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from scm.ztna_connector_all.models.connector_group_status_counts import ConnectorGroupStatusCounts +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupStatus(BaseModel): + """ + ConnectorGroupStatus + """ # noqa: E501 + anycast_ip: Optional[StrictStr] = None + counts: Optional[ConnectorGroupStatusCounts] = None + pa_region: Optional[StrictStr] = None + sw_version: Optional[StrictStr] = None + token_active: Optional[StrictStr] = None + token_secret: Optional[StrictStr] = None + user_id_ip: Optional[StrictStr] = None + user_id_port: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["anycast_ip", "counts", "pa_region", "sw_version", "token_active", "token_secret", "user_id_ip", "user_id_port"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 counts + if self.counts: + _dict['counts'] = self.counts.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "anycast_ip": obj.get("anycast_ip"), + "counts": ConnectorGroupStatusCounts.from_dict(obj["counts"]) if obj.get("counts") is not None else None, + "pa_region": obj.get("pa_region"), + "sw_version": obj.get("sw_version"), + "token_active": obj.get("token_active"), + "token_secret": obj.get("token_secret"), + "user_id_ip": obj.get("user_id_ip"), + "user_id_port": obj.get("user_id_port") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_status_counts.py b/scm/ztna_connector_all/models/connector_group_status_counts.py new file mode 100644 index 00000000..de3b6428 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_status_counts.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupStatusCounts(BaseModel): + """ + ConnectorGroupStatusCounts + """ # noqa: E501 + applications: Optional[StrictInt] = None + connectors: Optional[StrictInt] = None + ipsubnets: Optional[StrictInt] = None + wildcards: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["applications", "connectors", "ipsubnets", "wildcards"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupStatusCounts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ConnectorGroupStatusCounts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applications": obj.get("applications"), + "connectors": obj.get("connectors"), + "ipsubnets": obj.get("ipsubnets"), + "wildcards": obj.get("wildcards") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_subnet_rules.py b/scm/ztna_connector_all/models/connector_group_subnet_rules.py new file mode 100644 index 00000000..a0cdf7f3 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_subnet_rules.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from scm.ztna_connector_all.models.connector_group_connectors_connectors import ConnectorGroupConnectorsConnectors +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupSubnetRules(BaseModel): + """ + ConnectorGroupSubnetRules + """ # noqa: E501 + group: Optional[ConnectorGroups] = None + subnets: Optional[ConnectorGroupConnectorsConnectors] = None + __properties: ClassVar[List[str]] = ["group", "subnets"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupSubnetRules from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 group + if self.group: + _dict['group'] = self.group.to_dict() + # override the default output from pydantic by calling `to_dict()` of subnets + if self.subnets: + _dict['subnets'] = self.subnets.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupSubnetRules from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group": ConnectorGroups.from_dict(obj["group"]) if obj.get("group") is not None else None, + "subnets": ConnectorGroupConnectorsConnectors.from_dict(obj["subnets"]) if obj.get("subnets") is not None else None + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_upgrade_status.py b/scm/ztna_connector_all/models/connector_group_upgrade_status.py new file mode 100644 index 00000000..e41ed9aa --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_upgrade_status.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 +from typing import Any, ClassVar, Dict, List, Optional +from scm.ztna_connector_all.models.connector_group_upgrade_status_data_inner import ConnectorGroupUpgradeStatusDataInner +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupUpgradeStatus(BaseModel): + """ + ConnectorGroupUpgradeStatus + """ # noqa: E501 + data: Optional[List[ConnectorGroupUpgradeStatusDataInner]] = Field(default=None, description="List of connector upgrade statuses within this group") + name: Optional[StrictStr] = Field(default=None, description="Connector group name") + oid: Optional[StrictStr] = Field(default=None, description="Connector group ID") + rolling_upgrade: Optional[StrictBool] = Field(default=None, description="Whether rolling upgrade is enabled for this connector group") + upgrade_status: Optional[StrictStr] = Field(default=None, description="Overall upgrade status for the connector group") + __properties: ClassVar[List[str]] = ["data", "name", "oid", "rolling_upgrade", "upgrade_status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupUpgradeStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupUpgradeStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [ConnectorGroupUpgradeStatusDataInner.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "name": obj.get("name"), + "oid": obj.get("oid"), + "rolling_upgrade": obj.get("rolling_upgrade"), + "upgrade_status": obj.get("upgrade_status") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_upgrade_status_data_inner.py b/scm/ztna_connector_all/models/connector_group_upgrade_status_data_inner.py new file mode 100644 index 00000000..c03f164e --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_upgrade_status_data_inner.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 ConnectorGroupUpgradeStatusDataInner(BaseModel): + """ + ConnectorGroupUpgradeStatusDataInner + """ # noqa: E501 + connector_name: Optional[StrictStr] = Field(default=None, description="Connector name") + connector_oid: Optional[StrictStr] = Field(default=None, description="Connector ID") + current_sw_version: Optional[StrictStr] = Field(default=None, description="Current software version running on the connector") + drain_time: Optional[StrictInt] = Field(default=None, description="Time remaining until drain completes in seconds (present when connector is draining)") + failure_reason: Optional[StrictStr] = Field(default=None, description="Reason for upgrade failure (if upgrade failed)") + sessions_count: Optional[StrictInt] = Field(default=None, description="Number of active sessions (present when connector is draining)") + upgrade_status: Optional[StrictStr] = Field(default=None, description="Current upgrade status of the connector") + upgrade_sw_version: Optional[StrictStr] = Field(default=None, description="Target software version for the upgrade") + upgrade_time: Optional[StrictStr] = Field(default=None, description="Scheduled upgrade time") + __properties: ClassVar[List[str]] = ["connector_name", "connector_oid", "current_sw_version", "drain_time", "failure_reason", "sessions_count", "upgrade_status", "upgrade_sw_version", "upgrade_time"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupUpgradeStatusDataInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ConnectorGroupUpgradeStatusDataInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "connector_name": obj.get("connector_name"), + "connector_oid": obj.get("connector_oid"), + "current_sw_version": obj.get("current_sw_version"), + "drain_time": obj.get("drain_time"), + "failure_reason": obj.get("failure_reason"), + "sessions_count": obj.get("sessions_count"), + "upgrade_status": obj.get("upgrade_status"), + "upgrade_sw_version": obj.get("upgrade_sw_version"), + "upgrade_time": obj.get("upgrade_time") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_group_wildcards.py b/scm/ztna_connector_all/models/connector_group_wildcards.py new file mode 100644 index 00000000..ca485eae --- /dev/null +++ b/scm/ztna_connector_all/models/connector_group_wildcards.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from scm.ztna_connector_all.models.connector_group_connectors_connectors import ConnectorGroupConnectorsConnectors +from scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupWildcards(BaseModel): + """ + ConnectorGroupWildcards + """ # noqa: E501 + group: Optional[ConnectorGroups] = None + wildcards: Optional[ConnectorGroupConnectorsConnectors] = None + __properties: ClassVar[List[str]] = ["group", "wildcards"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupWildcards from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 group + if self.group: + _dict['group'] = self.group.to_dict() + # override the default output from pydantic by calling `to_dict()` of wildcards + if self.wildcards: + _dict['wildcards'] = self.wildcards.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupWildcards from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group": ConnectorGroups.from_dict(obj["group"]) if obj.get("group") is not None else None, + "wildcards": ConnectorGroupConnectorsConnectors.from_dict(obj["wildcards"]) if obj.get("wildcards") is not None else None + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_groups.py b/scm/ztna_connector_all/models/connector_groups.py new file mode 100644 index 00000000..f05851dd --- /dev/null +++ b/scm/ztna_connector_all/models/connector_groups.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroups(BaseModel): + """ + ConnectorGroups + """ # noqa: E501 + created_time: Optional[StrictStr] = None + description: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="Description of the connector group.") + is_autoscale: Optional[StrictBool] = Field(default=None, description="Whether the connector group is autoscaled. If omitted, defaults to false.") + is_ngfw: Optional[StrictBool] = Field(default=None, description="Connector group type. If false (default), the group is a ZTNA Connector group. If true, the group is an NGFW Connector group. If omitted, defaults to false.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="Name of the connector group. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period.") + oid: Optional[StrictStr] = Field(default=None, description="Connector Group ID") + pba_project_name: Optional[StrictStr] = Field(default=None, description="DPA project name that this connector group will serve. This field must be provided when the tenant is DPA-enabled, and must not be provided when the tenant is not DPA-enabled.") + preserve_user_id: Optional[StrictBool] = Field(default=None, description="Whether to preserve user ID for this connector group. If omitted, defaults to false.") + updated_time: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["created_time", "description", "is_autoscale", "is_ngfw", "name", "oid", "pba_project_name", "preserve_user_id", "updated_time"] + + @field_validator('description') + def description_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + return value + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + 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 ConnectorGroups from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_time", + "oid", + "updated_time", + ]) + + _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 ConnectorGroups from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_time": obj.get("created_time"), + "description": obj.get("description"), + "is_autoscale": obj.get("is_autoscale"), + "is_ngfw": obj.get("is_ngfw"), + "name": obj.get("name"), + "oid": obj.get("oid"), + "pba_project_name": obj.get("pba_project_name"), + "preserve_user_id": obj.get("preserve_user_id"), + "updated_time": obj.get("updated_time") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_groups_list_response.py b/scm/ztna_connector_all/models/connector_groups_list_response.py new file mode 100644 index 00000000..9ebe880b --- /dev/null +++ b/scm/ztna_connector_all/models/connector_groups_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.connector_groups import ConnectorGroups +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorGroupsListResponse(BaseModel): + """ + ConnectorGroupsListResponse + """ # noqa: E501 + data: List[ConnectorGroups] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorGroupsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorGroupsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = ConnectorGroups.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [ConnectorGroups.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_quiesce.py b/scm/ztna_connector_all/models/connector_quiesce.py new file mode 100644 index 00000000..981e6870 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_quiesce.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorQuiesce(BaseModel): + """ + ConnectorQuiesce + """ # noqa: E501 + mode: StrictStr + __properties: ClassVar[List[str]] = ["mode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorQuiesce from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ConnectorQuiesce from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_scheduled_upgrade.py b/scm/ztna_connector_all/models/connector_scheduled_upgrade.py new file mode 100644 index 00000000..8228d9b2 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_scheduled_upgrade.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorScheduledUpgrade(BaseModel): + """ + ConnectorScheduledUpgrade + """ # noqa: E501 + image_id: StrictStr = Field(description="The connector image version ID to upgrade to.") + scheduled_download: Optional[datetime] = Field(default=None, description="The scheduled download time in RFC3339 format (UTC). If omitted, defaults to current UTC time.") + scheduled_upgrade: Optional[datetime] = Field(default=None, description="The scheduled upgrade time in RFC3339 format (UTC). Must be after the scheduled_download time. If omitted, defaults to current UTC time.") + __properties: ClassVar[List[str]] = ["image_id", "scheduled_download", "scheduled_upgrade"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorScheduledUpgrade from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ConnectorScheduledUpgrade from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "image_id": obj.get("image_id"), + "scheduled_download": obj.get("scheduled_download"), + "scheduled_upgrade": obj.get("scheduled_upgrade") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_status.py b/scm/ztna_connector_all/models/connector_status.py new file mode 100644 index 00000000..a4a6fd6d --- /dev/null +++ b/scm/ztna_connector_all/models/connector_status.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.connector_status_flags import ConnectorStatusFlags +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorStatus(BaseModel): + """ + ConnectorStatus + """ # noqa: E501 + cgnx_location: Optional[StrictStr] = None + cgnx_scheduled_download: Optional[StrictStr] = None + cgnx_scheduled_sw_version: Optional[StrictStr] = None + cgnx_scheduled_upgrade: Optional[StrictStr] = None + cgnx_sw_version: Optional[StrictStr] = None + cgnx_upgrade_description: Optional[StrictStr] = None + cgnx_upgrade_download_percent: Optional[Union[StrictFloat, StrictInt]] = None + cgnx_upgrade_failure_info: Optional[StrictStr] = None + cgnx_upgrade_retry_count: Optional[Union[StrictFloat, StrictInt]] = None + cgnx_upgrade_state: Optional[StrictStr] = Field(default=None, description="When undefined, no upgrade is in progress.") + cgnx_upgrade_status_last_updated: Optional[StrictStr] = None + cgnx_vion_ip: Optional[StrictStr] = None + cidr: Optional[StrictStr] = None + error: Optional[Dict[str, Any]] = None + flags: Optional[ConnectorStatusFlags] = None + local_ip: Optional[StrictStr] = None + sc_id: Optional[StrictStr] = Field(default=None, description="Service Connection ID") + sc_name: Optional[StrictStr] = None + state_bits: Optional[Union[StrictFloat, StrictInt]] = None + token_active: Optional[StrictStr] = None + token_secret: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["cgnx_location", "cgnx_scheduled_download", "cgnx_scheduled_sw_version", "cgnx_scheduled_upgrade", "cgnx_sw_version", "cgnx_upgrade_description", "cgnx_upgrade_download_percent", "cgnx_upgrade_failure_info", "cgnx_upgrade_retry_count", "cgnx_upgrade_state", "cgnx_upgrade_status_last_updated", "cgnx_vion_ip", "cidr", "error", "flags", "local_ip", "sc_id", "sc_name", "state_bits", "token_active", "token_secret"] + + @field_validator('cgnx_upgrade_state') + def cgnx_upgrade_state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['download_cancelled', 'download_complete', 'download_discovery', 'download_failed', 'download_init', 'download_scheduled', 'failed', 'init', 'installing', 'install_failed', 'upgrade_cancelled', 'upgrade_init', 'upgrade_scheduled', 'upgrade_timeout', 'upgrading', 'verify', 'verifying']): + raise ValueError("must be one of enum values ('download_cancelled', 'download_complete', 'download_discovery', 'download_failed', 'download_init', 'download_scheduled', 'failed', 'init', 'installing', 'install_failed', 'upgrade_cancelled', 'upgrade_init', 'upgrade_scheduled', 'upgrade_timeout', 'upgrading', 'verify', 'verifying')") + 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 ConnectorStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 flags + if self.flags: + _dict['flags'] = self.flags.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cgnx_location": obj.get("cgnx_location"), + "cgnx_scheduled_download": obj.get("cgnx_scheduled_download"), + "cgnx_scheduled_sw_version": obj.get("cgnx_scheduled_sw_version"), + "cgnx_scheduled_upgrade": obj.get("cgnx_scheduled_upgrade"), + "cgnx_sw_version": obj.get("cgnx_sw_version"), + "cgnx_upgrade_description": obj.get("cgnx_upgrade_description"), + "cgnx_upgrade_download_percent": obj.get("cgnx_upgrade_download_percent"), + "cgnx_upgrade_failure_info": obj.get("cgnx_upgrade_failure_info"), + "cgnx_upgrade_retry_count": obj.get("cgnx_upgrade_retry_count"), + "cgnx_upgrade_state": obj.get("cgnx_upgrade_state"), + "cgnx_upgrade_status_last_updated": obj.get("cgnx_upgrade_status_last_updated"), + "cgnx_vion_ip": obj.get("cgnx_vion_ip"), + "cidr": obj.get("cidr"), + "error": obj.get("error"), + "flags": ConnectorStatusFlags.from_dict(obj["flags"]) if obj.get("flags") is not None else None, + "local_ip": obj.get("local_ip"), + "sc_id": obj.get("sc_id"), + "sc_name": obj.get("sc_name"), + "state_bits": obj.get("state_bits"), + "token_active": obj.get("token_active"), + "token_secret": obj.get("token_secret") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_status_flags.py b/scm/ztna_connector_all/models/connector_status_flags.py new file mode 100644 index 00000000..578b76af --- /dev/null +++ b/scm/ztna_connector_all/models/connector_status_flags.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from scm.ztna_connector_all.models.connector_status_flags_capabilities import ConnectorStatusFlagsCapabilities +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorStatusFlags(BaseModel): + """ + ConnectorStatusFlags + """ # noqa: E501 + capabilities: Optional[ConnectorStatusFlagsCapabilities] = None + config_state: Optional[StrictStr] = None + control_plane_up: Optional[StrictBool] = None + token_state: Optional[StrictStr] = None + tunnel_up: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["capabilities", "config_state", "control_plane_up", "token_state", "tunnel_up"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorStatusFlags from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorStatusFlags from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "capabilities": ConnectorStatusFlagsCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "config_state": obj.get("config_state"), + "control_plane_up": obj.get("control_plane_up"), + "token_state": obj.get("token_state"), + "tunnel_up": obj.get("tunnel_up") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_status_flags_capabilities.py b/scm/ztna_connector_all/models/connector_status_flags_capabilities.py new file mode 100644 index 00000000..a57b5312 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_status_flags_capabilities.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorStatusFlagsCapabilities(BaseModel): + """ + ConnectorStatusFlagsCapabilities + """ # noqa: E501 + ipsubnet_supported: Optional[StrictBool] = None + wildcard_supported: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["ipsubnet_supported", "wildcard_supported"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorStatusFlagsCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ConnectorStatusFlagsCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ipsubnet_supported": obj.get("ipsubnet_supported"), + "wildcard_supported": obj.get("wildcard_supported") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connector_upgrade_status.py b/scm/ztna_connector_all/models/connector_upgrade_status.py new file mode 100644 index 00000000..c929e971 --- /dev/null +++ b/scm/ztna_connector_all/models/connector_upgrade_status.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 ConnectorUpgradeStatus(BaseModel): + """ + ConnectorUpgradeStatus + """ # noqa: E501 + active_image_id: Optional[StrictStr] = Field(default=None, description="Currently active image ID") + active_version: Optional[StrictStr] = Field(default=None, description="Currently active software version") + download_percent: Optional[StrictInt] = Field(default=None, description="Download progress percentage") + failure_info: Optional[StrictStr] = Field(default=None, description="Failure information if upgrade failed") + previous_image_id: Optional[StrictStr] = Field(default=None, description="Previous image ID") + scheduled_download: Optional[StrictStr] = Field(default=None, description="Scheduled download time") + scheduled_upgrade: Optional[StrictStr] = Field(default=None, description="Scheduled upgrade time") + upgrade_description: Optional[StrictStr] = Field(default=None, description="Description of the upgrade") + upgrade_image_id: Optional[StrictStr] = Field(default=None, description="Target upgrade image ID") + upgrade_state: Optional[StrictStr] = Field(default=None, description="Current state of the upgrade process") + __properties: ClassVar[List[str]] = ["active_image_id", "active_version", "download_percent", "failure_info", "previous_image_id", "scheduled_download", "scheduled_upgrade", "upgrade_description", "upgrade_image_id", "upgrade_state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorUpgradeStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ConnectorUpgradeStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "active_image_id": obj.get("active_image_id"), + "active_version": obj.get("active_version"), + "download_percent": obj.get("download_percent"), + "failure_info": obj.get("failure_info"), + "previous_image_id": obj.get("previous_image_id"), + "scheduled_download": obj.get("scheduled_download"), + "scheduled_upgrade": obj.get("scheduled_upgrade"), + "upgrade_description": obj.get("upgrade_description"), + "upgrade_image_id": obj.get("upgrade_image_id"), + "upgrade_state": obj.get("upgrade_state") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connectors.py b/scm/ztna_connector_all/models/connectors.py new file mode 100644 index 00000000..10ccb507 --- /dev/null +++ b/scm/ztna_connector_all/models/connectors.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class Connectors(BaseModel): + """ + Connectors + """ # noqa: E501 + created_time: Optional[StrictStr] = None + description: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="Description of the connector.") + group: StrictStr = Field(description="The connector group id") + name: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="Name of the connector. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period.") + oid: Optional[StrictStr] = Field(default=None, description="Id of the entry.") + updated_time: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["created_time", "description", "group", "name", "oid", "updated_time"] + + @field_validator('description') + def description_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + return value + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + 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 Connectors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_time", + "oid", + "updated_time", + ]) + + _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 Connectors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "created_time": obj.get("created_time"), + "description": obj.get("description"), + "group": obj.get("group"), + "name": obj.get("name"), + "oid": obj.get("oid"), + "updated_time": obj.get("updated_time") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/connectors_list_response.py b/scm/ztna_connector_all/models/connectors_list_response.py new file mode 100644 index 00000000..3eddaf27 --- /dev/null +++ b/scm/ztna_connector_all/models/connectors_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.connectors import Connectors +from typing import Optional, Set +from typing_extensions import Self + +class ConnectorsListResponse(BaseModel): + """ + ConnectorsListResponse + """ # noqa: E501 + data: List[Connectors] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConnectorsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConnectorsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = Connectors.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [Connectors.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/diagnostic_file_list.py b/scm/ztna_connector_all/models/diagnostic_file_list.py new file mode 100644 index 00000000..35b04e6a --- /dev/null +++ b/scm/ztna_connector_all/models/diagnostic_file_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from scm.ztna_connector_all.models.diagnostic_file_list_data_inner import DiagnosticFileListDataInner +from typing import Optional, Set +from typing_extensions import Self + +class DiagnosticFileList(BaseModel): + """ + DiagnosticFileList + """ # noqa: E501 + data: Optional[List[DiagnosticFileListDataInner]] = None + __properties: ClassVar[List[str]] = ["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 DiagnosticFileList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiagnosticFileList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [DiagnosticFileListDataInner.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/diagnostic_file_list_data_inner.py b/scm/ztna_connector_all/models/diagnostic_file_list_data_inner.py new file mode 100644 index 00000000..a8d6ace4 --- /dev/null +++ b/scm/ztna_connector_all/models/diagnostic_file_list_data_inner.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 DiagnosticFileListDataInner(BaseModel): + """ + DiagnosticFileListDataInner + """ # noqa: E501 + var_date: Optional[StrictStr] = Field(default=None, alias="date") + filename: Optional[StrictStr] = Field(default=None, description="Name of the file.") + filesize: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Size of the file.") + id: Optional[StrictStr] = Field(default=None, description="Request id") + state: Optional[StrictStr] = Field(default=None, description="stopped, complete, inprogress") + __properties: ClassVar[List[str]] = ["date", "filename", "filesize", "id", "state"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['inprogress', 'complete', 'stopped']): + raise ValueError("must be one of enum values ('inprogress', 'complete', 'stopped')") + 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 DiagnosticFileListDataInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 DiagnosticFileListDataInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "filename": obj.get("filename"), + "filesize": obj.get("filesize"), + "id": obj.get("id"), + "state": obj.get("state") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/discovered_applications.py b/scm/ztna_connector_all/models/discovered_applications.py new file mode 100644 index 00000000..7c87a0e8 --- /dev/null +++ b/scm/ztna_connector_all/models/discovered_applications.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from scm.ztna_connector_all.models.discovered_applications_applications_inner import DiscoveredApplicationsApplicationsInner +from typing import Optional, Set +from typing_extensions import Self + +class DiscoveredApplications(BaseModel): + """ + DiscoveredApplications + """ # noqa: E501 + applications: Optional[List[DiscoveredApplicationsApplicationsInner]] = None + cie_tenant_id: Optional[StrictStr] = None + count: Optional[Union[StrictFloat, StrictInt]] = None + tenant_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["applications", "cie_tenant_id", "count", "tenant_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscoveredApplications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 applications (list) + _items = [] + if self.applications: + for _item_applications in self.applications: + if _item_applications: + _items.append(_item_applications.to_dict()) + _dict['applications'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscoveredApplications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applications": [DiscoveredApplicationsApplicationsInner.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, + "cie_tenant_id": obj.get("cie_tenant_id"), + "count": obj.get("count"), + "tenant_id": obj.get("tenant_id") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/discovered_applications_applications_inner.py b/scm/ztna_connector_all/models/discovered_applications_applications_inner.py new file mode 100644 index 00000000..3268890c --- /dev/null +++ b/scm/ztna_connector_all/models/discovered_applications_applications_inner.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from scm.ztna_connector_all.models.discovered_applications_applications_inner_app_spec_inner import DiscoveredApplicationsApplicationsInnerAppSpecInner +from typing import Optional, Set +from typing_extensions import Self + +class DiscoveredApplicationsApplicationsInner(BaseModel): + """ + DiscoveredApplicationsApplicationsInner + """ # noqa: E501 + app_spec: Optional[List[DiscoveredApplicationsApplicationsInnerAppSpecInner]] = None + fqdn: Optional[StrictStr] = None + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + port: Optional[StrictStr] = None + protocol: Optional[StrictStr] = None + provider: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["app_spec", "fqdn", "id", "name", "port", "protocol", "provider"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscoveredApplicationsApplicationsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 app_spec (list) + _items = [] + if self.app_spec: + for _item_app_spec in self.app_spec: + if _item_app_spec: + _items.append(_item_app_spec.to_dict()) + _dict['app_spec'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscoveredApplicationsApplicationsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app_spec": [DiscoveredApplicationsApplicationsInnerAppSpecInner.from_dict(_item) for _item in obj["app_spec"]] if obj.get("app_spec") is not None else None, + "fqdn": obj.get("fqdn"), + "id": obj.get("id"), + "name": obj.get("name"), + "port": obj.get("port"), + "protocol": obj.get("protocol"), + "provider": obj.get("provider") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/discovered_applications_applications_inner_app_spec_inner.py b/scm/ztna_connector_all/models/discovered_applications_applications_inner_app_spec_inner.py new file mode 100644 index 00000000..569fd4d3 --- /dev/null +++ b/scm/ztna_connector_all/models/discovered_applications_applications_inner_app_spec_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DiscoveredApplicationsApplicationsInnerAppSpecInner(BaseModel): + """ + DiscoveredApplicationsApplicationsInnerAppSpecInner + """ # noqa: E501 + fqdn: Optional[StrictStr] = None + port: Optional[StrictStr] = None + protocol: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["fqdn", "port", "protocol"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscoveredApplicationsApplicationsInnerAppSpecInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 DiscoveredApplicationsApplicationsInnerAppSpecInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fqdn": obj.get("fqdn"), + "port": obj.get("port"), + "protocol": obj.get("protocol") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/discovered_applications_list_response.py b/scm/ztna_connector_all/models/discovered_applications_list_response.py new file mode 100644 index 00000000..6ea4713e --- /dev/null +++ b/scm/ztna_connector_all/models/discovered_applications_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.discovered_applications import DiscoveredApplications +from typing import Optional, Set +from typing_extensions import Self + +class DiscoveredApplicationsListResponse(BaseModel): + """ + DiscoveredApplicationsListResponse + """ # noqa: E501 + data: List[DiscoveredApplications] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DiscoveredApplicationsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DiscoveredApplicationsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = DiscoveredApplications.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [DiscoveredApplications.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/error_detail.py b/scm/ztna_connector_all/models/error_detail.py new file mode 100644 index 00000000..91292f9e --- /dev/null +++ b/scm/ztna_connector_all/models/error_detail.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.error_detail_causes_inner import ErrorDetailCausesInner +from typing import Optional, Set +from typing_extensions import Self + +class ErrorDetail(BaseModel): + """ + Error detail information following Google Cloud API CauseInfo format + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="Type identifier for the detail object", alias="@type") + causes: Optional[List[ErrorDetailCausesInner]] = Field(default=None, description="Array of cause information objects") + message: Optional[StrictStr] = Field(default=None, description="Detailed error message") + __properties: ClassVar[List[str]] = ["@type", "causes", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 causes (list) + _items = [] + if self.causes: + for _item_causes in self.causes: + if _item_causes: + _items.append(_item_causes.to_dict()) + _dict['causes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "@type": obj.get("@type"), + "causes": [ErrorDetailCausesInner.from_dict(_item) for _item in obj["causes"]] if obj.get("causes") is not None else None, + "message": obj.get("message") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/error_detail_causes_inner.py b/scm/ztna_connector_all/models/error_detail_causes_inner.py new file mode 100644 index 00000000..0898d3c7 --- /dev/null +++ b/scm/ztna_connector_all/models/error_detail_causes_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 ErrorDetailCausesInner(BaseModel): + """ + ErrorDetailCausesInner + """ # noqa: E501 + message: Optional[StrictStr] = Field(default=None, description="Cause message") + module: Optional[StrictStr] = Field(default=None, description="Module where the cause originated") + __properties: ClassVar[List[str]] = ["message", "module"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorDetailCausesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 ErrorDetailCausesInner 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"), + "module": obj.get("module") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/error_object.py b/scm/ztna_connector_all/models/error_object.py new file mode 100644 index 00000000..3b3d533c --- /dev/null +++ b/scm/ztna_connector_all/models/error_object.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.error_detail import ErrorDetail +from typing import Optional, Set +from typing_extensions import Self + +class ErrorObject(BaseModel): + """ + Error object following Google Cloud API error format + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="Error code") + details: Optional[List[ErrorDetail]] = Field(default=None, description="Additional error details") + message: Optional[StrictStr] = Field(default=None, description="Human-readable error message") + __properties: ClassVar[List[str]] = ["code", "details", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 details (list) + _items = [] + if self.details: + for _item_details in self.details: + if _item_details: + _items.append(_item_details.to_dict()) + _dict['details'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "details": [ErrorDetail.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None, + "message": obj.get("message") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/error_response.py b/scm/ztna_connector_all/models/error_response.py new file mode 100644 index 00000000..680403c8 --- /dev/null +++ b/scm/ztna_connector_all/models/error_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.error_object import ErrorObject +from typing import Optional, Set +from typing_extensions import Self + +class ErrorResponse(BaseModel): + """ + Error response payload + """ # noqa: E501 + error: ErrorObject + __properties: ClassVar[List[str]] = ["error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 error + if self.error: + _dict['error'] = self.error.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": ErrorObject.from_dict(obj["error"]) if obj.get("error") is not None else None + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/license_info.py b/scm/ztna_connector_all/models/license_info.py new file mode 100644 index 00000000..b9a492f5 --- /dev/null +++ b/scm/ztna_connector_all/models/license_info.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class LicenseInfo(BaseModel): + """ + LicenseInfo + """ # noqa: E501 + applications: Optional[Union[StrictFloat, StrictInt]] = None + connectors: Optional[Union[StrictFloat, StrictInt]] = None + expiry: Optional[datetime] = None + license_name: Optional[StrictStr] = None + max_applications: Optional[Union[StrictFloat, StrictInt]] = None + max_connectors: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["applications", "connectors", "expiry", "license_name", "max_applications", "max_connectors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LicenseInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 LicenseInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "applications": obj.get("applications"), + "connectors": obj.get("connectors"), + "expiry": obj.get("expiry"), + "license_name": obj.get("license_name"), + "max_applications": obj.get("max_applications"), + "max_connectors": obj.get("max_connectors") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/packet_capture.py b/scm/ztna_connector_all/models/packet_capture.py new file mode 100644 index 00000000..4c31adc5 --- /dev/null +++ b/scm/ztna_connector_all/models/packet_capture.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class PacketCapture(BaseModel): + """ + PacketCapture + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Request id generated by the micro-service, and is used on other API calls") + message: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Return code description") + status: Optional[StrictStr] = Field(default=None, description="Return code (CDBG_ERROR or CDBG_OK)") + __properties: ClassVar[List[str]] = ["id", "message", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PacketCapture from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 PacketCapture 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"), + "message": obj.get("message"), + "status": obj.get("status") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/packet_capture_create.py b/scm/ztna_connector_all/models/packet_capture_create.py new file mode 100644 index 00000000..f2f25095 --- /dev/null +++ b/scm/ztna_connector_all/models/packet_capture_create.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 PacketCaptureCreate(BaseModel): + """ + PacketCaptureCreate + """ # noqa: E501 + host: Optional[StrictStr] = Field(default=None, description="IPv4 address") + interface: StrictStr = Field(description="Following are the acceptable labels - internal, external, tunnel") + port: Optional[StrictStr] = Field(default=None, description="Port number") + protocol: Optional[StrictStr] = Field(default=None, description="Following are the acceptable labels - TCP, UDP, ICMP, ARP") + __properties: ClassVar[List[str]] = ["host", "interface", "port", "protocol"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PacketCaptureCreate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 PacketCaptureCreate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "host": obj.get("host"), + "interface": obj.get("interface"), + "port": obj.get("port"), + "protocol": obj.get("protocol") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/start_tenant_offboarding202_response.py b/scm/ztna_connector_all/models/start_tenant_offboarding202_response.py new file mode 100644 index 00000000..0930c4c6 --- /dev/null +++ b/scm/ztna_connector_all/models/start_tenant_offboarding202_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 StartTenantOffboarding202Response(BaseModel): + """ + StartTenantOffboarding202Response + """ # noqa: E501 + msg: Optional[StrictStr] = Field(default=None, description="Confirmation message") + __properties: ClassVar[List[str]] = ["msg"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of StartTenantOffboarding202Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 StartTenantOffboarding202Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "msg": obj.get("msg") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/subnets.py b/scm/ztna_connector_all/models/subnets.py new file mode 100644 index 00000000..1392c2c7 --- /dev/null +++ b/scm/ztna_connector_all/models/subnets.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class Subnets(BaseModel): + """ + Subnets + """ # noqa: E501 + app_enabled: Optional[StrictBool] = Field(default=None, description="Whether the IP subnet rule is enabled. If omitted, defaults to false.") + created_time: Optional[StrictStr] = None + description: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + group: StrictStr = Field(description="A comma separated list of connector group IDs") + icmp_allowed: Optional[StrictBool] = Field(default=None, description="Whether ICMP is allowed for this IP subnet rule. If omitted, defaults to true.") + ip_subnets: StrictStr = Field(description="IPv4 subnet in CIDR notation (x.x.x.x/y)") + name: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="Name of the IP Subnet rule. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period.") + oid: Optional[StrictStr] = Field(default=None, description="Id of the entry.") + updated_time: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["app_enabled", "created_time", "description", "group", "icmp_allowed", "ip_subnets", "name", "oid", "updated_time"] + + @field_validator('description') + def description_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + return value + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + 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 Subnets from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_time", + "oid", + "updated_time", + ]) + + _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 Subnets from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app_enabled": obj.get("app_enabled"), + "created_time": obj.get("created_time"), + "description": obj.get("description"), + "group": obj.get("group"), + "icmp_allowed": obj.get("icmp_allowed"), + "ip_subnets": obj.get("ip_subnets"), + "name": obj.get("name"), + "oid": obj.get("oid"), + "updated_time": obj.get("updated_time") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/subnets_list_response.py b/scm/ztna_connector_all/models/subnets_list_response.py new file mode 100644 index 00000000..5c2ddfc6 --- /dev/null +++ b/scm/ztna_connector_all/models/subnets_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.subnets import Subnets +from typing import Optional, Set +from typing_extensions import Self + +class SubnetsListResponse(BaseModel): + """ + SubnetsListResponse + """ # noqa: E501 + data: List[Subnets] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubnetsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubnetsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = Subnets.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [Subnets.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/tenant_status.py b/scm/ztna_connector_all/models/tenant_status.py new file mode 100644 index 00000000..56027156 --- /dev/null +++ b/scm/ztna_connector_all/models/tenant_status.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 TenantStatus(BaseModel): + """ + TenantStatus + """ # noqa: E501 + status: StrictStr = Field(description="Tenant status") + __properties: ClassVar[List[str]] = ["status"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ok', 'not_found', 'delete_in_progress']): + raise ValueError("must be one of enum values ('ok', 'not_found', 'delete_in_progress')") + 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 TenantStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 TenantStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/wildcards.py b/scm/ztna_connector_all/models/wildcards.py new file mode 100644 index 00000000..845ff2b2 --- /dev/null +++ b/scm/ztna_connector_all/models/wildcards.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class Wildcards(BaseModel): + """ + Wildcards + """ # noqa: E501 + app_enabled: Optional[StrictBool] = Field(default=None, description="Whether the wildcard is enabled. If omitted, defaults to false.") + applications: Optional[Dict[str, Any]] = Field(default=None, description="Discovered Wildcard App oid to name mapping.") + created_time: Optional[StrictStr] = None + description: Optional[Annotated[str, Field(strict=True, max_length=64)]] = None + enable_policy: Optional[StrictBool] = Field(default=None, description="Whether policy is enabled for this wildcard. If omitted, defaults to false.") + fqdn: StrictStr = Field(description="The wildcard to match.") + group: StrictStr = Field(description="A comma separated list of connector group IDs") + icmp_allowed: Optional[StrictBool] = Field(default=None, description="Whether ICMP is allowed for this wildcard. If omitted, defaults to true.") + id: Optional[StrictStr] = Field(default=None, description="Id of the entry as returned by list/get operations.") + name: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="Name of the wildcard. It can only be 64 characters long and contain unicode text, space, dash, or underscore, or period.") + oid: Optional[StrictStr] = Field(default=None, description="Id of the entry.") + probe_port: Optional[StrictStr] = Field(default=None, description="The probing port if the `probe_type` is `tcp_ping`.") + probe_type: Optional[StrictStr] = Field(default=None, description="The probing type. The value can be `tcp_ping`, `icmp_ping`, or omitted.") + tcp_port: Optional[StrictStr] = Field(default=None, description="TCP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443.") + udp_port: Optional[StrictStr] = Field(default=None, description="UDP port number(s). It can be a single port number, multiple port numbers separated by comma, or a port range like 8000-9000. If both tcp_port and udp_port are omitted, tcp_port defaults to 443.") + updated_time: Optional[StrictStr] = None + use_dc_ip: Optional[StrictBool] = Field(default=None, description="Whether to use datacenter IP for this wildcard. If omitted, defaults to false.") + __properties: ClassVar[List[str]] = ["app_enabled", "applications", "created_time", "description", "enable_policy", "fqdn", "group", "icmp_allowed", "id", "name", "oid", "probe_port", "probe_type", "tcp_port", "udp_port", "updated_time", "use_dc_ip"] + + @field_validator('description') + def description_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + return value + + @field_validator('name') + def name_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[\p{L}\p{N}\p{P}\s,.:_-]*$", value): + raise ValueError(r"must validate the regular expression /^[\p{L}\p{N}\p{P}\s,.:_-]*$/") + return value + + @field_validator('probe_type') + def probe_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['tcp_ping', 'icmp_ping']): + raise ValueError("must be one of enum values ('tcp_ping', 'icmp_ping')") + 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 Wildcards from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "applications", + "created_time", + "id", + "oid", + "updated_time", + ]) + + _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 Wildcards from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "app_enabled": obj.get("app_enabled"), + "applications": obj.get("applications"), + "created_time": obj.get("created_time"), + "description": obj.get("description"), + "enable_policy": obj.get("enable_policy"), + "fqdn": obj.get("fqdn"), + "group": obj.get("group"), + "icmp_allowed": obj.get("icmp_allowed"), + "id": obj.get("id"), + "name": obj.get("name"), + "oid": obj.get("oid"), + "probe_port": obj.get("probe_port"), + "probe_type": obj.get("probe_type"), + "tcp_port": obj.get("tcp_port"), + "udp_port": obj.get("udp_port"), + "updated_time": obj.get("updated_time"), + "use_dc_ip": obj.get("use_dc_ip") + }) + return _obj + + diff --git a/scm/ztna_connector_all/models/wildcards_list_response.py b/scm/ztna_connector_all/models/wildcards_list_response.py new file mode 100644 index 00000000..cf521160 --- /dev/null +++ b/scm/ztna_connector_all/models/wildcards_list_response.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.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 scm.ztna_connector_all.models.wildcards import Wildcards +from typing import Optional, Set +from typing_extensions import Self + +class WildcardsListResponse(BaseModel): + """ + WildcardsListResponse + """ # noqa: E501 + data: List[Wildcards] + limit: StrictInt = Field(description="The maximum number of results per page") + offset: StrictInt = Field(description="The offset into the list of results returned") + total: StrictInt = Field(description="The total count of results") + __properties: ClassVar[List[str]] = ["data", "limit", "offset", "total"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WildcardsListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WildcardsListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # Detect bare object response (API returns single object instead of paginated list) + # This happens when server-side name filtering returns exactly one result + if "data" not in obj and "total" not in obj: + single_obj = Wildcards.from_dict(obj) + return cls.model_validate({ + "data": [single_obj] if single_obj is not None else [], + "limit": 1, + "offset": 0, + "total": 1 if single_obj is not None else 0, + }) + + _obj = cls.model_validate({ + "data": [Wildcards.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "limit": obj.get("limit") if obj.get("limit") is not None else 200, + "offset": obj.get("offset") if obj.get("offset") is not None else 0, + "total": obj.get("total") + }) + return _obj + + diff --git a/scm/ztna_connector_all/rest.py b/scm/ztna_connector_all/rest.py new file mode 100644 index 00000000..2b492f15 --- /dev/null +++ b/scm/ztna_connector_all/rest.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + ZTNA Connector Restful API + + ZTNA Connector Restful API Specification + + The version of the OpenAPI document: v2 + Contact: support@paloaltonetworks.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from scm.ztna_connector_all.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + self.pool_manager: urllib3.PoolManager + + if configuration.proxy: + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) + else: + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Perform requests. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + # Fix: urllib3 sets Accept-Encoding: identity when preload_content=False, + # but some endpoints return 500 error with this header. + # Set to gzip, deflate which servers typically accept. + if 'Accept-Encoding' not in headers: + headers['Accept-Encoding'] = 'gzip, deflate' + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, + url, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=True, + timeout=timeout, + headers=headers, + preload_content=False + ) + # Pass a `string` parameter directly in the body to support + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) From 570ec80a71bc63c4d8b4a681b15d061ce50e75b4 Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Thu, 23 Jul 2026 11:19:03 -0700 Subject: [PATCH 12/13] Fixes #116, #125, #118, #126, #128 issues --- scm/deployment_services/__init__.py | 2 +- .../docs/RemoteNetworksProtocol.md | 2 +- .../docs/ServiceConnections.md | 1 - .../docs/ServiceConnectionsBgpPeer.md | 34 ------- .../docs/ServiceConnectionsProtocol.md | 1 + .../docs/ServiceConnectionsProtocolBgpPeer.md | 33 +++++++ scm/deployment_services/models/__init__.py | 2 +- .../models/remote_networks_protocol.py | 2 +- .../models/service_connections.py | 8 +- .../models/service_connections_protocol.py | 10 +- ... service_connections_protocol_bgp_peer.py} | 24 +++-- .../models/export_certificate_payload.py | 4 +- scm/network_services/__init__.py | 3 +- .../docs/AggregateInterfacesLayer2.md | 1 + .../docs/AggregateInterfacesLayer3.md | 1 + .../docs/EthernetInterfacesLayer2.md | 2 +- .../docs/EthernetInterfacesLayer2Lldp.md | 30 ------ .../docs/EthernetInterfacesLayer3.md | 1 + scm/network_services/docs/Lldp.md | 32 +++++++ .../docs/LldpHighAvailability.md | 30 ++++++ scm/network_services/docs/PbfRules.md | 2 + scm/network_services/models/__init__.py | 3 +- .../models/aggregate_interfaces_layer2.py | 8 +- .../models/aggregate_interfaces_layer3.py | 8 +- .../models/ethernet_interfaces_layer2.py | 6 +- .../models/ethernet_interfaces_layer3.py | 8 +- scm/network_services/models/lldp.py | 96 +++++++++++++++++++ ...yer2_lldp.py => lldp_high_availability.py} | 18 ++-- scm/network_services/models/pbf_rules.py | 8 +- 29 files changed, 267 insertions(+), 113 deletions(-) delete mode 100644 scm/deployment_services/docs/ServiceConnectionsBgpPeer.md create mode 100644 scm/deployment_services/docs/ServiceConnectionsProtocolBgpPeer.md rename scm/deployment_services/models/{service_connections_bgp_peer.py => service_connections_protocol_bgp_peer.py} (74%) delete mode 100644 scm/network_services/docs/EthernetInterfacesLayer2Lldp.md create mode 100644 scm/network_services/docs/Lldp.md create mode 100644 scm/network_services/docs/LldpHighAvailability.md create mode 100644 scm/network_services/models/lldp.py rename scm/network_services/models/{ethernet_interfaces_layer2_lldp.py => lldp_high_availability.py} (78%) diff --git a/scm/deployment_services/__init__.py b/scm/deployment_services/__init__.py index 1f452aa3..e04ddf9c 100644 --- a/scm/deployment_services/__init__.py +++ b/scm/deployment_services/__init__.py @@ -65,10 +65,10 @@ from scm.deployment_services.models.service_connection_groups import ServiceConnectionGroups from scm.deployment_services.models.service_connection_groups_list_response import ServiceConnectionGroupsListResponse from scm.deployment_services.models.service_connections import ServiceConnections -from scm.deployment_services.models.service_connections_bgp_peer import ServiceConnectionsBgpPeer from scm.deployment_services.models.service_connections_list_response import ServiceConnectionsListResponse from scm.deployment_services.models.service_connections_protocol import ServiceConnectionsProtocol from scm.deployment_services.models.service_connections_protocol_bgp import ServiceConnectionsProtocolBgp +from scm.deployment_services.models.service_connections_protocol_bgp_peer import ServiceConnectionsProtocolBgpPeer from scm.deployment_services.models.service_connections_qos import ServiceConnectionsQos from scm.deployment_services.models.shared_infrastructure_settings import SharedInfrastructureSettings from scm.deployment_services.models.sites import Sites diff --git a/scm/deployment_services/docs/RemoteNetworksProtocol.md b/scm/deployment_services/docs/RemoteNetworksProtocol.md index b3baab77..dca13107 100644 --- a/scm/deployment_services/docs/RemoteNetworksProtocol.md +++ b/scm/deployment_services/docs/RemoteNetworksProtocol.md @@ -1,6 +1,6 @@ # RemoteNetworksProtocol -setup the protocol when ecmp_load_balancing is disable +setup the protocol when ecmp_load_balancing is disabled ## Properties diff --git a/scm/deployment_services/docs/ServiceConnections.md b/scm/deployment_services/docs/ServiceConnections.md index d65e533d..f83a3e29 100644 --- a/scm/deployment_services/docs/ServiceConnections.md +++ b/scm/deployment_services/docs/ServiceConnections.md @@ -6,7 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **backup_sc** | **str** | | [optional] -**bgp_peer** | [**ServiceConnectionsBgpPeer**](ServiceConnectionsBgpPeer.md) | | [optional] **id** | **str** | The UUID of the service connection | [readonly] **ipsec_tunnel** | **str** | | **name** | **str** | The name of the service connection | diff --git a/scm/deployment_services/docs/ServiceConnectionsBgpPeer.md b/scm/deployment_services/docs/ServiceConnectionsBgpPeer.md deleted file mode 100644 index 6c79fa0c..00000000 --- a/scm/deployment_services/docs/ServiceConnectionsBgpPeer.md +++ /dev/null @@ -1,34 +0,0 @@ -# ServiceConnectionsBgpPeer - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**local_ip_address** | **str** | | [optional] -**local_ipv6_address** | **str** | | [optional] -**peer_ip_address** | **str** | | [optional] -**peer_ipv6_address** | **str** | | [optional] -**same_as_primary** | **bool** | Same peer IP address for SC | [optional] -**secret** | **str** | | [optional] - -## Example - -```python -from scm.deployment_services.models.service_connections_bgp_peer import ServiceConnectionsBgpPeer - -# TODO update the JSON string below -json = "{}" -# create an instance of ServiceConnectionsBgpPeer from a JSON string -service_connections_bgp_peer_instance = ServiceConnectionsBgpPeer.from_json(json) -# print the JSON string representation of the object -print(ServiceConnectionsBgpPeer.to_json()) - -# convert the object into a dict -service_connections_bgp_peer_dict = service_connections_bgp_peer_instance.to_dict() -# create an instance of ServiceConnectionsBgpPeer from a dict -service_connections_bgp_peer_from_dict = ServiceConnectionsBgpPeer.from_dict(service_connections_bgp_peer_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/scm/deployment_services/docs/ServiceConnectionsProtocol.md b/scm/deployment_services/docs/ServiceConnectionsProtocol.md index 89dadcbd..1c6f7bc6 100644 --- a/scm/deployment_services/docs/ServiceConnectionsProtocol.md +++ b/scm/deployment_services/docs/ServiceConnectionsProtocol.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bgp** | [**ServiceConnectionsProtocolBgp**](ServiceConnectionsProtocolBgp.md) | | [optional] +**bgp_peer** | [**ServiceConnectionsProtocolBgpPeer**](ServiceConnectionsProtocolBgpPeer.md) | | [optional] ## Example diff --git a/scm/deployment_services/docs/ServiceConnectionsProtocolBgpPeer.md b/scm/deployment_services/docs/ServiceConnectionsProtocolBgpPeer.md new file mode 100644 index 00000000..cf876ad6 --- /dev/null +++ b/scm/deployment_services/docs/ServiceConnectionsProtocolBgpPeer.md @@ -0,0 +1,33 @@ +# ServiceConnectionsProtocolBgpPeer + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**local_ip_address** | **str** | Local peer IP address (secondary WAN) | [optional] +**local_ipv6_address** | **str** | Local peer IPv6 address (secondary WAN) | [optional] +**peer_ip_address** | **str** | Remote peer IP address (secondary WAN) | [optional] +**peer_ipv6_address** | **str** | Remote peer IPv6 address (secondary WAN) | [optional] +**secret** | **str** | BGP peering secret (secondary WAN) | [optional] + +## Example + +```python +from scm.deployment_services.models.service_connections_protocol_bgp_peer import ServiceConnectionsProtocolBgpPeer + +# TODO update the JSON string below +json = "{}" +# create an instance of ServiceConnectionsProtocolBgpPeer from a JSON string +service_connections_protocol_bgp_peer_instance = ServiceConnectionsProtocolBgpPeer.from_json(json) +# print the JSON string representation of the object +print(ServiceConnectionsProtocolBgpPeer.to_json()) + +# convert the object into a dict +service_connections_protocol_bgp_peer_dict = service_connections_protocol_bgp_peer_instance.to_dict() +# create an instance of ServiceConnectionsProtocolBgpPeer from a dict +service_connections_protocol_bgp_peer_from_dict = ServiceConnectionsProtocolBgpPeer.from_dict(service_connections_protocol_bgp_peer_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/scm/deployment_services/models/__init__.py b/scm/deployment_services/models/__init__.py index bd6b0b74..468be8b4 100644 --- a/scm/deployment_services/models/__init__.py +++ b/scm/deployment_services/models/__init__.py @@ -38,10 +38,10 @@ from scm.deployment_services.models.service_connection_groups import ServiceConnectionGroups from scm.deployment_services.models.service_connection_groups_list_response import ServiceConnectionGroupsListResponse from scm.deployment_services.models.service_connections import ServiceConnections -from scm.deployment_services.models.service_connections_bgp_peer import ServiceConnectionsBgpPeer from scm.deployment_services.models.service_connections_list_response import ServiceConnectionsListResponse from scm.deployment_services.models.service_connections_protocol import ServiceConnectionsProtocol from scm.deployment_services.models.service_connections_protocol_bgp import ServiceConnectionsProtocolBgp +from scm.deployment_services.models.service_connections_protocol_bgp_peer import ServiceConnectionsProtocolBgpPeer from scm.deployment_services.models.service_connections_qos import ServiceConnectionsQos from scm.deployment_services.models.shared_infrastructure_settings import SharedInfrastructureSettings from scm.deployment_services.models.sites import Sites diff --git a/scm/deployment_services/models/remote_networks_protocol.py b/scm/deployment_services/models/remote_networks_protocol.py index 4aab82f4..15ad9fd8 100644 --- a/scm/deployment_services/models/remote_networks_protocol.py +++ b/scm/deployment_services/models/remote_networks_protocol.py @@ -27,7 +27,7 @@ class RemoteNetworksProtocol(BaseModel): """ - setup the protocol when ecmp_load_balancing is disable + setup the protocol when ecmp_load_balancing is disabled """ # noqa: E501 bgp: Optional[RemoteNetworksProtocolBgp] = None bgp_peer: Optional[RemoteNetworksProtocolBgpPeer] = None diff --git a/scm/deployment_services/models/service_connections.py b/scm/deployment_services/models/service_connections.py index 9d74f8b1..7fd45d45 100644 --- a/scm/deployment_services/models/service_connections.py +++ b/scm/deployment_services/models/service_connections.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from scm.deployment_services.models.service_connections_bgp_peer import ServiceConnectionsBgpPeer from scm.deployment_services.models.service_connections_protocol import ServiceConnectionsProtocol from scm.deployment_services.models.service_connections_qos import ServiceConnectionsQos from typing import Optional, Set @@ -31,7 +30,6 @@ class ServiceConnections(BaseModel): ServiceConnections """ # noqa: E501 backup_sc: Optional[StrictStr] = Field(default=None, alias="backup_SC") - bgp_peer: Optional[ServiceConnectionsBgpPeer] = None id: StrictStr = Field(description="The UUID of the service connection") ipsec_tunnel: StrictStr name: StrictStr = Field(description="The name of the service connection") @@ -45,7 +43,7 @@ class ServiceConnections(BaseModel): secondary_ipsec_tunnel: Optional[StrictStr] = None source_nat: Optional[StrictBool] = None subnets: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["backup_SC", "bgp_peer", "id", "ipsec_tunnel", "name", "nat_pool", "no_export_community", "onboarding_type", "protocol", "qos", "region", "region_tag", "secondary_ipsec_tunnel", "source_nat", "subnets"] + __properties: ClassVar[List[str]] = ["backup_SC", "id", "ipsec_tunnel", "name", "nat_pool", "no_export_community", "onboarding_type", "protocol", "qos", "region", "region_tag", "secondary_ipsec_tunnel", "source_nat", "subnets"] @field_validator('no_export_community') def no_export_community_validate_enum(cls, value): @@ -108,9 +106,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of bgp_peer - if self.bgp_peer: - _dict['bgp_peer'] = self.bgp_peer.to_dict() # override the default output from pydantic by calling `to_dict()` of protocol if self.protocol: _dict['protocol'] = self.protocol.to_dict() @@ -130,7 +125,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "backup_SC": obj.get("backup_SC"), - "bgp_peer": ServiceConnectionsBgpPeer.from_dict(obj["bgp_peer"]) if obj.get("bgp_peer") is not None else None, "id": obj.get("id"), "ipsec_tunnel": obj.get("ipsec_tunnel"), "name": obj.get("name"), diff --git a/scm/deployment_services/models/service_connections_protocol.py b/scm/deployment_services/models/service_connections_protocol.py index d65a4e4a..09d3a2fc 100644 --- a/scm/deployment_services/models/service_connections_protocol.py +++ b/scm/deployment_services/models/service_connections_protocol.py @@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional from scm.deployment_services.models.service_connections_protocol_bgp import ServiceConnectionsProtocolBgp +from scm.deployment_services.models.service_connections_protocol_bgp_peer import ServiceConnectionsProtocolBgpPeer from typing import Optional, Set from typing_extensions import Self @@ -29,7 +30,8 @@ class ServiceConnectionsProtocol(BaseModel): ServiceConnectionsProtocol """ # noqa: E501 bgp: Optional[ServiceConnectionsProtocolBgp] = None - __properties: ClassVar[List[str]] = ["bgp"] + bgp_peer: Optional[ServiceConnectionsProtocolBgpPeer] = None + __properties: ClassVar[List[str]] = ["bgp", "bgp_peer"] model_config = ConfigDict( populate_by_name=True, @@ -73,6 +75,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of bgp if self.bgp: _dict['bgp'] = self.bgp.to_dict() + # override the default output from pydantic by calling `to_dict()` of bgp_peer + if self.bgp_peer: + _dict['bgp_peer'] = self.bgp_peer.to_dict() return _dict @classmethod @@ -85,7 +90,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "bgp": ServiceConnectionsProtocolBgp.from_dict(obj["bgp"]) if obj.get("bgp") is not None else None + "bgp": ServiceConnectionsProtocolBgp.from_dict(obj["bgp"]) if obj.get("bgp") is not None else None, + "bgp_peer": ServiceConnectionsProtocolBgpPeer.from_dict(obj["bgp_peer"]) if obj.get("bgp_peer") is not None else None }) return _obj diff --git a/scm/deployment_services/models/service_connections_bgp_peer.py b/scm/deployment_services/models/service_connections_protocol_bgp_peer.py similarity index 74% rename from scm/deployment_services/models/service_connections_bgp_peer.py rename to scm/deployment_services/models/service_connections_protocol_bgp_peer.py index 0ee7ca11..de5cdd27 100644 --- a/scm/deployment_services/models/service_connections_bgp_peer.py +++ b/scm/deployment_services/models/service_connections_protocol_bgp_peer.py @@ -18,22 +18,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, SecretStr, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, SecretStr, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class ServiceConnectionsBgpPeer(BaseModel): +class ServiceConnectionsProtocolBgpPeer(BaseModel): """ - ServiceConnectionsBgpPeer + ServiceConnectionsProtocolBgpPeer """ # noqa: E501 - local_ip_address: Optional[StrictStr] = None - local_ipv6_address: Optional[StrictStr] = None - peer_ip_address: Optional[StrictStr] = None - peer_ipv6_address: Optional[StrictStr] = None - same_as_primary: Optional[StrictBool] = Field(default=None, description="Same peer IP address for SC") - secret: Optional[SecretStr] = None - __properties: ClassVar[List[str]] = ["local_ip_address", "local_ipv6_address", "peer_ip_address", "peer_ipv6_address", "same_as_primary", "secret"] + local_ip_address: Optional[StrictStr] = Field(default=None, description="Local peer IP address (secondary WAN)") + local_ipv6_address: Optional[StrictStr] = Field(default=None, description="Local peer IPv6 address (secondary WAN)") + peer_ip_address: Optional[StrictStr] = Field(default=None, description="Remote peer IP address (secondary WAN)") + peer_ipv6_address: Optional[StrictStr] = Field(default=None, description="Remote peer IPv6 address (secondary WAN)") + secret: Optional[SecretStr] = Field(default=None, description="BGP peering secret (secondary WAN)") + __properties: ClassVar[List[str]] = ["local_ip_address", "local_ipv6_address", "peer_ip_address", "peer_ipv6_address", "secret"] model_config = ConfigDict( populate_by_name=True, @@ -53,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ServiceConnectionsBgpPeer from a JSON string""" + """Create an instance of ServiceConnectionsProtocolBgpPeer from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -78,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ServiceConnectionsBgpPeer from a dict""" + """Create an instance of ServiceConnectionsProtocolBgpPeer from a dict""" if obj is None: return None @@ -90,7 +89,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "local_ipv6_address": obj.get("local_ipv6_address"), "peer_ip_address": obj.get("peer_ip_address"), "peer_ipv6_address": obj.get("peer_ipv6_address"), - "same_as_primary": obj.get("same_as_primary"), "secret": obj.get("secret") }) return _obj diff --git a/scm/identity_services/models/export_certificate_payload.py b/scm/identity_services/models/export_certificate_payload.py index 8cb1f780..b69c201a 100644 --- a/scm/identity_services/models/export_certificate_payload.py +++ b/scm/identity_services/models/export_certificate_payload.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, SecretStr, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -28,7 +28,7 @@ class ExportCertificatePayload(BaseModel): ExportCertificatePayload """ # noqa: E501 format: StrictStr - passphrase: Optional[StrictStr] = None + passphrase: Optional[SecretStr] = None __properties: ClassVar[List[str]] = ["format", "passphrase"] @field_validator('format') diff --git a/scm/network_services/__init__.py b/scm/network_services/__init__.py index db0c6c28..c0f8d3d2 100644 --- a/scm/network_services/__init__.py +++ b/scm/network_services/__init__.py @@ -247,7 +247,6 @@ from scm.network_services.models.ethernet_interfaces_arp_inner import EthernetInterfacesArpInner from scm.network_services.models.ethernet_interfaces_dhcp_client import EthernetInterfacesDhcpClient from scm.network_services.models.ethernet_interfaces_layer2 import EthernetInterfacesLayer2 -from scm.network_services.models.ethernet_interfaces_layer2_lldp import EthernetInterfacesLayer2Lldp from scm.network_services.models.ethernet_interfaces_layer3 import EthernetInterfacesLayer3 from scm.network_services.models.ethernet_interfaces_layer3_ddns_config import EthernetInterfacesLayer3DdnsConfig from scm.network_services.models.ethernet_interfaces_layer3_dhcp_client import EthernetInterfacesLayer3DhcpClient @@ -324,6 +323,8 @@ from scm.network_services.models.license_result import LicenseResult from scm.network_services.models.link_tags import LinkTags from scm.network_services.models.link_tags_list_response import LinkTagsListResponse +from scm.network_services.models.lldp import Lldp +from scm.network_services.models.lldp_high_availability import LldpHighAvailability from scm.network_services.models.lldp_profiles import LldpProfiles from scm.network_services.models.lldp_profiles_option_tlvs import LldpProfilesOptionTlvs from scm.network_services.models.lldp_profiles_option_tlvs_management_address import LldpProfilesOptionTlvsManagementAddress diff --git a/scm/network_services/docs/AggregateInterfacesLayer2.md b/scm/network_services/docs/AggregateInterfacesLayer2.md index a37fe11b..136f7582 100644 --- a/scm/network_services/docs/AggregateInterfacesLayer2.md +++ b/scm/network_services/docs/AggregateInterfacesLayer2.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **lacp** | [**Lacp**](Lacp.md) | | [optional] +**lldp** | [**Lldp**](Lldp.md) | | [optional] **netflow_profile** | **str** | Name of Netflow Profile to assign to Interface | [optional] **vlan_tag** | **str** | VLAN tag | [optional] diff --git a/scm/network_services/docs/AggregateInterfacesLayer3.md b/scm/network_services/docs/AggregateInterfacesLayer3.md index c7fed953..d20c0234 100644 --- a/scm/network_services/docs/AggregateInterfacesLayer3.md +++ b/scm/network_services/docs/AggregateInterfacesLayer3.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **interface_management_profile** | **str** | Interface management profile | [optional] **ip** | [**List[AggregateInterfacesLayer3IpInner]**](AggregateInterfacesLayer3IpInner.md) | Aggregate Interface IP addresses | [optional] **lacp** | [**Lacp**](Lacp.md) | | [optional] +**lldp** | [**Lldp**](Lldp.md) | | [optional] **mtu** | **int** | MTU | [optional] [default to 1500] **netflow_profile** | **str** | Name of Netflow Profile to assign to Interface | [optional] diff --git a/scm/network_services/docs/EthernetInterfacesLayer2.md b/scm/network_services/docs/EthernetInterfacesLayer2.md index d21d6a02..23e32168 100644 --- a/scm/network_services/docs/EthernetInterfacesLayer2.md +++ b/scm/network_services/docs/EthernetInterfacesLayer2.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**lldp** | [**EthernetInterfacesLayer2Lldp**](EthernetInterfacesLayer2Lldp.md) | | [optional] +**lldp** | [**Lldp**](Lldp.md) | | [optional] **netflow_profile** | **str** | Name of Netflow Profile to assign to Interface | [optional] **vlan_tag** | **str** | Assign interface to VLAN tag | [optional] diff --git a/scm/network_services/docs/EthernetInterfacesLayer2Lldp.md b/scm/network_services/docs/EthernetInterfacesLayer2Lldp.md deleted file mode 100644 index 9261d972..00000000 --- a/scm/network_services/docs/EthernetInterfacesLayer2Lldp.md +++ /dev/null @@ -1,30 +0,0 @@ -# EthernetInterfacesLayer2Lldp - -LLDP Settings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enable** | **bool** | Enable LLDP on Interface | [default to False] - -## Example - -```python -from scm.network_services.models.ethernet_interfaces_layer2_lldp import EthernetInterfacesLayer2Lldp - -# TODO update the JSON string below -json = "{}" -# create an instance of EthernetInterfacesLayer2Lldp from a JSON string -ethernet_interfaces_layer2_lldp_instance = EthernetInterfacesLayer2Lldp.from_json(json) -# print the JSON string representation of the object -print(EthernetInterfacesLayer2Lldp.to_json()) - -# convert the object into a dict -ethernet_interfaces_layer2_lldp_dict = ethernet_interfaces_layer2_lldp_instance.to_dict() -# create an instance of EthernetInterfacesLayer2Lldp from a dict -ethernet_interfaces_layer2_lldp_from_dict = EthernetInterfacesLayer2Lldp.from_dict(ethernet_interfaces_layer2_lldp_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/scm/network_services/docs/EthernetInterfacesLayer3.md b/scm/network_services/docs/EthernetInterfacesLayer3.md index da9908ca..1a5c3d42 100644 --- a/scm/network_services/docs/EthernetInterfacesLayer3.md +++ b/scm/network_services/docs/EthernetInterfacesLayer3.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **dhcp_client** | [**EthernetInterfacesLayer3DhcpClient**](EthernetInterfacesLayer3DhcpClient.md) | | [optional] **interface_management_profile** | **str** | Interface management profile | [optional] **ip** | [**List[EthernetInterfacesLayer3IpInner]**](EthernetInterfacesLayer3IpInner.md) | Ethernet Interface IP addresses | [optional] +**lldp** | [**Lldp**](Lldp.md) | | [optional] **mtu** | **int** | MTU | [optional] [default to 1500] **netflow_profile** | **str** | Name of Netflow Profile to assign to Interface | [optional] **pppoe** | [**EthernetInterfacesLayer3Pppoe**](EthernetInterfacesLayer3Pppoe.md) | | [optional] diff --git a/scm/network_services/docs/Lldp.md b/scm/network_services/docs/Lldp.md new file mode 100644 index 00000000..b2ca000e --- /dev/null +++ b/scm/network_services/docs/Lldp.md @@ -0,0 +1,32 @@ +# Lldp + +LLDP settings for the interface + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enable** | **bool** | Enable LLDP on Interface | [default to False] +**high_availability** | [**LldpHighAvailability**](LldpHighAvailability.md) | | [optional] +**profile** | **str** | Name of the LLDP profile to assign to the interface | [optional] + +## Example + +```python +from scm.network_services.models.lldp import Lldp + +# TODO update the JSON string below +json = "{}" +# create an instance of Lldp from a JSON string +lldp_instance = Lldp.from_json(json) +# print the JSON string representation of the object +print(Lldp.to_json()) + +# convert the object into a dict +lldp_dict = lldp_instance.to_dict() +# create an instance of Lldp from a dict +lldp_from_dict = Lldp.from_dict(lldp_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/scm/network_services/docs/LldpHighAvailability.md b/scm/network_services/docs/LldpHighAvailability.md new file mode 100644 index 00000000..32128c19 --- /dev/null +++ b/scm/network_services/docs/LldpHighAvailability.md @@ -0,0 +1,30 @@ +# LldpHighAvailability + +LLDP high availability settings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**passive_pre_negotiation** | **bool** | | [optional] [default to False] + +## Example + +```python +from scm.network_services.models.lldp_high_availability import LldpHighAvailability + +# TODO update the JSON string below +json = "{}" +# create an instance of LldpHighAvailability from a JSON string +lldp_high_availability_instance = LldpHighAvailability.from_json(json) +# print the JSON string representation of the object +print(LldpHighAvailability.to_json()) + +# convert the object into a dict +lldp_high_availability_dict = lldp_high_availability_instance.to_dict() +# create an instance of LldpHighAvailability from a dict +lldp_high_availability_from_dict = LldpHighAvailability.from_dict(lldp_high_availability_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/scm/network_services/docs/PbfRules.md b/scm/network_services/docs/PbfRules.md index 95cf99a4..363bd28a 100644 --- a/scm/network_services/docs/PbfRules.md +++ b/scm/network_services/docs/PbfRules.md @@ -15,6 +15,8 @@ Name | Type | Description | Notes **var_from** | [**PbfRulesFrom**](PbfRulesFrom.md) | | [optional] **id** | **str** | UUID of the resource | [optional] [readonly] **name** | **str** | PBF rule name | [optional] +**negate_destination** | **bool** | Negate destination address | [optional] [default to False] +**negate_source** | **bool** | Negate source address | [optional] [default to False] **schedule** | **str** | Schedule | [optional] **service** | **List[str]** | Services | [optional] **snippet** | **str** | The snippet in which the resource is defined | [optional] diff --git a/scm/network_services/models/__init__.py b/scm/network_services/models/__init__.py index e319ec8e..c33dbe84 100644 --- a/scm/network_services/models/__init__.py +++ b/scm/network_services/models/__init__.py @@ -181,7 +181,6 @@ from scm.network_services.models.ethernet_interfaces_arp_inner import EthernetInterfacesArpInner from scm.network_services.models.ethernet_interfaces_dhcp_client import EthernetInterfacesDhcpClient from scm.network_services.models.ethernet_interfaces_layer2 import EthernetInterfacesLayer2 -from scm.network_services.models.ethernet_interfaces_layer2_lldp import EthernetInterfacesLayer2Lldp from scm.network_services.models.ethernet_interfaces_layer3 import EthernetInterfacesLayer3 from scm.network_services.models.ethernet_interfaces_layer3_ddns_config import EthernetInterfacesLayer3DdnsConfig from scm.network_services.models.ethernet_interfaces_layer3_dhcp_client import EthernetInterfacesLayer3DhcpClient @@ -258,6 +257,8 @@ from scm.network_services.models.license_result import LicenseResult from scm.network_services.models.link_tags import LinkTags from scm.network_services.models.link_tags_list_response import LinkTagsListResponse +from scm.network_services.models.lldp import Lldp +from scm.network_services.models.lldp_high_availability import LldpHighAvailability from scm.network_services.models.lldp_profiles import LldpProfiles from scm.network_services.models.lldp_profiles_option_tlvs import LldpProfilesOptionTlvs from scm.network_services.models.lldp_profiles_option_tlvs_management_address import LldpProfilesOptionTlvsManagementAddress diff --git a/scm/network_services/models/aggregate_interfaces_layer2.py b/scm/network_services/models/aggregate_interfaces_layer2.py index 7c65ba23..7274f7bb 100644 --- a/scm/network_services/models/aggregate_interfaces_layer2.py +++ b/scm/network_services/models/aggregate_interfaces_layer2.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from scm.network_services.models.lacp import Lacp +from scm.network_services.models.lldp import Lldp from typing import Optional, Set from typing_extensions import Self @@ -30,9 +31,10 @@ class AggregateInterfacesLayer2(BaseModel): AggregateInterfacesLayer2 """ # noqa: E501 lacp: Optional[Lacp] = None + lldp: Optional[Lldp] = None netflow_profile: Optional[StrictStr] = Field(default=None, description="Name of Netflow Profile to assign to Interface") vlan_tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="VLAN tag") - __properties: ClassVar[List[str]] = ["lacp", "netflow_profile", "vlan_tag"] + __properties: ClassVar[List[str]] = ["lacp", "lldp", "netflow_profile", "vlan_tag"] @field_validator('vlan_tag') def vlan_tag_validate_regular_expression(cls, value): @@ -86,6 +88,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of lacp if self.lacp: _dict['lacp'] = self.lacp.to_dict() + # override the default output from pydantic by calling `to_dict()` of lldp + if self.lldp: + _dict['lldp'] = self.lldp.to_dict() return _dict @classmethod @@ -99,6 +104,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "lacp": Lacp.from_dict(obj["lacp"]) if obj.get("lacp") is not None else None, + "lldp": Lldp.from_dict(obj["lldp"]) if obj.get("lldp") is not None else None, "netflow_profile": obj.get("netflow_profile"), "vlan_tag": obj.get("vlan_tag") }) diff --git a/scm/network_services/models/aggregate_interfaces_layer3.py b/scm/network_services/models/aggregate_interfaces_layer3.py index d76dab0b..1c710b8f 100644 --- a/scm/network_services/models/aggregate_interfaces_layer3.py +++ b/scm/network_services/models/aggregate_interfaces_layer3.py @@ -26,6 +26,7 @@ from scm.network_services.models.aggregate_interfaces_layer3_ddns_config import AggregateInterfacesLayer3DdnsConfig from scm.network_services.models.aggregate_interfaces_layer3_ip_inner import AggregateInterfacesLayer3IpInner from scm.network_services.models.lacp import Lacp +from scm.network_services.models.lldp import Lldp from typing import Optional, Set from typing_extensions import Self @@ -39,9 +40,10 @@ class AggregateInterfacesLayer3(BaseModel): interface_management_profile: Optional[Annotated[str, Field(strict=True, max_length=31)]] = Field(default=None, description="Interface management profile") ip: Optional[List[AggregateInterfacesLayer3IpInner]] = Field(default=None, description="Aggregate Interface IP addresses") lacp: Optional[Lacp] = None + lldp: Optional[Lldp] = None mtu: Optional[Annotated[int, Field(le=9216, strict=True, ge=576)]] = Field(default=1500, description="MTU") netflow_profile: Optional[StrictStr] = Field(default=None, description="Name of Netflow Profile to assign to Interface") - __properties: ClassVar[List[str]] = ["arp", "ddns_config", "dhcp_client", "interface_management_profile", "ip", "lacp", "mtu", "netflow_profile"] + __properties: ClassVar[List[str]] = ["arp", "ddns_config", "dhcp_client", "interface_management_profile", "ip", "lacp", "lldp", "mtu", "netflow_profile"] model_config = ConfigDict( populate_by_name=True, @@ -105,6 +107,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of lacp if self.lacp: _dict['lacp'] = self.lacp.to_dict() + # override the default output from pydantic by calling `to_dict()` of lldp + if self.lldp: + _dict['lldp'] = self.lldp.to_dict() return _dict @classmethod @@ -123,6 +128,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "interface_management_profile": obj.get("interface_management_profile"), "ip": [AggregateInterfacesLayer3IpInner.from_dict(_item) for _item in obj["ip"]] if obj.get("ip") is not None else None, "lacp": Lacp.from_dict(obj["lacp"]) if obj.get("lacp") is not None else None, + "lldp": Lldp.from_dict(obj["lldp"]) if obj.get("lldp") is not None else None, "mtu": obj.get("mtu") if obj.get("mtu") is not None else 1500, "netflow_profile": obj.get("netflow_profile") }) diff --git a/scm/network_services/models/ethernet_interfaces_layer2.py b/scm/network_services/models/ethernet_interfaces_layer2.py index 012b2aac..5401e02d 100644 --- a/scm/network_services/models/ethernet_interfaces_layer2.py +++ b/scm/network_services/models/ethernet_interfaces_layer2.py @@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from scm.network_services.models.ethernet_interfaces_layer2_lldp import EthernetInterfacesLayer2Lldp +from scm.network_services.models.lldp import Lldp from typing import Optional, Set from typing_extensions import Self @@ -29,7 +29,7 @@ class EthernetInterfacesLayer2(BaseModel): """ EthernetInterfacesLayer2 """ # noqa: E501 - lldp: Optional[EthernetInterfacesLayer2Lldp] = None + lldp: Optional[Lldp] = None netflow_profile: Optional[StrictStr] = Field(default=None, description="Name of Netflow Profile to assign to Interface") vlan_tag: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Assign interface to VLAN tag") __properties: ClassVar[List[str]] = ["lldp", "netflow_profile", "vlan_tag"] @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "lldp": EthernetInterfacesLayer2Lldp.from_dict(obj["lldp"]) if obj.get("lldp") is not None else None, + "lldp": Lldp.from_dict(obj["lldp"]) if obj.get("lldp") is not None else None, "netflow_profile": obj.get("netflow_profile"), "vlan_tag": obj.get("vlan_tag") }) diff --git a/scm/network_services/models/ethernet_interfaces_layer3.py b/scm/network_services/models/ethernet_interfaces_layer3.py index 2b3838c8..2747e660 100644 --- a/scm/network_services/models/ethernet_interfaces_layer3.py +++ b/scm/network_services/models/ethernet_interfaces_layer3.py @@ -26,6 +26,7 @@ from scm.network_services.models.ethernet_interfaces_layer3_dhcp_client import EthernetInterfacesLayer3DhcpClient from scm.network_services.models.ethernet_interfaces_layer3_ip_inner import EthernetInterfacesLayer3IpInner from scm.network_services.models.ethernet_interfaces_layer3_pppoe import EthernetInterfacesLayer3Pppoe +from scm.network_services.models.lldp import Lldp from typing import Optional, Set from typing_extensions import Self @@ -38,10 +39,11 @@ class EthernetInterfacesLayer3(BaseModel): dhcp_client: Optional[EthernetInterfacesLayer3DhcpClient] = None interface_management_profile: Optional[Annotated[str, Field(strict=True, max_length=31)]] = Field(default=None, description="Interface management profile") ip: Optional[List[EthernetInterfacesLayer3IpInner]] = Field(default=None, description="Ethernet Interface IP addresses") + lldp: Optional[Lldp] = None mtu: Optional[Annotated[int, Field(le=9216, strict=True, ge=576)]] = Field(default=1500, description="MTU") netflow_profile: Optional[StrictStr] = Field(default=None, description="Name of Netflow Profile to assign to Interface") pppoe: Optional[EthernetInterfacesLayer3Pppoe] = None - __properties: ClassVar[List[str]] = ["arp", "ddns_config", "dhcp_client", "interface_management_profile", "ip", "mtu", "netflow_profile", "pppoe"] + __properties: ClassVar[List[str]] = ["arp", "ddns_config", "dhcp_client", "interface_management_profile", "ip", "lldp", "mtu", "netflow_profile", "pppoe"] model_config = ConfigDict( populate_by_name=True, @@ -102,6 +104,9 @@ def to_dict(self) -> Dict[str, Any]: if _item_ip: _items.append(_item_ip.to_dict()) _dict['ip'] = _items + # override the default output from pydantic by calling `to_dict()` of lldp + if self.lldp: + _dict['lldp'] = self.lldp.to_dict() # override the default output from pydantic by calling `to_dict()` of pppoe if self.pppoe: _dict['pppoe'] = self.pppoe.to_dict() @@ -122,6 +127,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "dhcp_client": EthernetInterfacesLayer3DhcpClient.from_dict(obj["dhcp_client"]) if obj.get("dhcp_client") is not None else None, "interface_management_profile": obj.get("interface_management_profile"), "ip": [EthernetInterfacesLayer3IpInner.from_dict(_item) for _item in obj["ip"]] if obj.get("ip") is not None else None, + "lldp": Lldp.from_dict(obj["lldp"]) if obj.get("lldp") is not None else None, "mtu": obj.get("mtu") if obj.get("mtu") is not None else 1500, "netflow_profile": obj.get("netflow_profile"), "pppoe": EthernetInterfacesLayer3Pppoe.from_dict(obj["pppoe"]) if obj.get("pppoe") is not None else None diff --git a/scm/network_services/models/lldp.py b/scm/network_services/models/lldp.py new file mode 100644 index 00000000..b7406388 --- /dev/null +++ b/scm/network_services/models/lldp.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Network Services + + These APIs are used for defining and managing network services configuration within Strata Cloud Manager. + + The version of the OpenAPI document: 2.0.0 + Contact: support@paloaltonetworks.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 +from typing import Any, ClassVar, Dict, List, Optional +from scm.network_services.models.lldp_high_availability import LldpHighAvailability +from typing import Optional, Set +from typing_extensions import Self + +class Lldp(BaseModel): + """ + LLDP settings for the interface + """ # noqa: E501 + enable: StrictBool = Field(description="Enable LLDP on Interface") + high_availability: Optional[LldpHighAvailability] = None + profile: Optional[StrictStr] = Field(default=None, description="Name of the LLDP profile to assign to the interface") + __properties: ClassVar[List[str]] = ["enable", "high_availability", "profile"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Lldp from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other 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 high_availability + if self.high_availability: + _dict['high_availability'] = self.high_availability.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Lldp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enable": obj.get("enable") if obj.get("enable") is not None else False, + "high_availability": LldpHighAvailability.from_dict(obj["high_availability"]) if obj.get("high_availability") is not None else None, + "profile": obj.get("profile") + }) + return _obj + + diff --git a/scm/network_services/models/ethernet_interfaces_layer2_lldp.py b/scm/network_services/models/lldp_high_availability.py similarity index 78% rename from scm/network_services/models/ethernet_interfaces_layer2_lldp.py rename to scm/network_services/models/lldp_high_availability.py index c12c1931..4227cd1e 100644 --- a/scm/network_services/models/ethernet_interfaces_layer2_lldp.py +++ b/scm/network_services/models/lldp_high_availability.py @@ -18,17 +18,17 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class EthernetInterfacesLayer2Lldp(BaseModel): +class LldpHighAvailability(BaseModel): """ - LLDP Settings + LLDP high availability settings """ # noqa: E501 - enable: StrictBool = Field(description="Enable LLDP on Interface") - __properties: ClassVar[List[str]] = ["enable"] + passive_pre_negotiation: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["passive_pre_negotiation"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EthernetInterfacesLayer2Lldp from a JSON string""" + """Create an instance of LldpHighAvailability from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EthernetInterfacesLayer2Lldp from a dict""" + """Create an instance of LldpHighAvailability from a dict""" if obj is None: return None @@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "enable": obj.get("enable") if obj.get("enable") is not None else False + "passive_pre_negotiation": obj.get("passive_pre_negotiation") if obj.get("passive_pre_negotiation") is not None else False }) return _obj diff --git a/scm/network_services/models/pbf_rules.py b/scm/network_services/models/pbf_rules.py index 96843fd5..905c6a03 100644 --- a/scm/network_services/models/pbf_rules.py +++ b/scm/network_services/models/pbf_rules.py @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from scm.network_services.models.pbf_rules_action import PbfRulesAction @@ -41,13 +41,15 @@ class PbfRules(BaseModel): var_from: Optional[PbfRulesFrom] = Field(default=None, alias="from") id: Optional[StrictStr] = Field(default=None, description="UUID of the resource") name: Optional[StrictStr] = Field(default=None, description="PBF rule name") + negate_destination: Optional[StrictBool] = Field(default=False, description="Negate destination address") + negate_source: Optional[StrictBool] = Field(default=False, description="Negate source address") schedule: Optional[StrictStr] = Field(default=None, description="Schedule") service: Optional[List[StrictStr]] = Field(default=None, description="Services") snippet: Optional[Annotated[str, Field(strict=True, max_length=64)]] = Field(default=None, description="The snippet in which the resource is defined") source: Optional[List[StrictStr]] = Field(default=None, description="Source addresses") source_user: Optional[List[StrictStr]] = Field(default=None, description="Source users") tag: Optional[List[StrictStr]] = Field(default=None, description="Tags") - __properties: ClassVar[List[str]] = ["action", "application", "description", "destination", "device", "enforce_symmetric_return", "folder", "from", "id", "name", "schedule", "service", "snippet", "source", "source_user", "tag"] + __properties: ClassVar[List[str]] = ["action", "application", "description", "destination", "device", "enforce_symmetric_return", "folder", "from", "id", "name", "negate_destination", "negate_source", "schedule", "service", "snippet", "source", "source_user", "tag"] @field_validator('device') def device_validate_regular_expression(cls, value): @@ -151,6 +153,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "from": PbfRulesFrom.from_dict(obj["from"]) if obj.get("from") is not None else None, "id": obj.get("id"), "name": obj.get("name"), + "negate_destination": obj.get("negate_destination") if obj.get("negate_destination") is not None else False, + "negate_source": obj.get("negate_source") if obj.get("negate_source") is not None else False, "schedule": obj.get("schedule"), "service": obj.get("service"), "snippet": obj.get("snippet"), From ab1a87422391ee0dd7b0681146adc581a44f46df Mon Sep 17 00:00:00 2001 From: Dhiren Chotwani Date: Tue, 28 Jul 2026 18:23:43 -0700 Subject: [PATCH 13/13] fix(security_services): update internet_rule_type and security_rules models Regenerated from openapi-integration-creator develop branch. Co-Authored-By: Claude Opus 4.6 --- scm/security_services/docs/InternetRuleType.md | 2 +- scm/security_services/docs/SecurityRules.md | 2 +- scm/security_services/models/internet_rule_type.py | 4 ++-- scm/security_services/models/security_rules.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scm/security_services/docs/InternetRuleType.md b/scm/security_services/docs/InternetRuleType.md index c31145f3..6dc9758e 100644 --- a/scm/security_services/docs/InternetRuleType.md +++ b/scm/security_services/docs/InternetRuleType.md @@ -21,7 +21,7 @@ Name | Type | Description | Notes **log_settings** | [**InternetRuleTypeLogSettings**](InternetRuleTypeLogSettings.md) | | [optional] **name** | **str** | The name of the security rule | **negate_source** | **bool** | Negate the source address(es)? | [optional] [default to False] -**negate_user** | **bool** | | [optional] [default to False] +**negate_user** | **bool** | | [optional] **policy_type** | **str** | | [optional] [default to 'Security'] **schedule** | **str** | Schedule in which this rule will be applied | [optional] **security_settings** | [**InternetRuleTypeSecuritySettings**](InternetRuleTypeSecuritySettings.md) | | [optional] diff --git a/scm/security_services/docs/SecurityRules.md b/scm/security_services/docs/SecurityRules.md index de969edb..70515b5f 100644 --- a/scm/security_services/docs/SecurityRules.md +++ b/scm/security_services/docs/SecurityRules.md @@ -30,7 +30,7 @@ Name | Type | Description | Notes **name** | **str** | The name of the security rule | [optional] **negate_destination** | **bool** | Negate the destination addresses(es)? | [optional] [default to False] **negate_source** | **bool** | Negate the source address(es)? | [optional] [default to False] -**negate_user** | **bool** | | [optional] [default to False] +**negate_user** | **bool** | | [optional] **policy_type** | **str** | | [optional] [default to 'Security'] **profile_setting** | [**SecurityRuleTypeProfileSetting**](SecurityRuleTypeProfileSetting.md) | | [optional] **schedule** | **str** | Schedule in which this rule will be applied | [optional] diff --git a/scm/security_services/models/internet_rule_type.py b/scm/security_services/models/internet_rule_type.py index 520ce667..65d6ed53 100644 --- a/scm/security_services/models/internet_rule_type.py +++ b/scm/security_services/models/internet_rule_type.py @@ -47,7 +47,7 @@ class InternetRuleType(BaseModel): log_settings: Optional[InternetRuleTypeLogSettings] = None name: StrictStr = Field(description="The name of the security rule") negate_source: Optional[StrictBool] = Field(default=False, description="Negate the source address(es)?") - negate_user: Optional[StrictBool] = False + negate_user: Optional[StrictBool] = None policy_type: Optional[StrictStr] = 'Security' schedule: Optional[StrictStr] = Field(default=None, description="Schedule in which this rule will be applied") security_settings: Optional[InternetRuleTypeSecuritySettings] = None @@ -159,7 +159,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "log_settings": InternetRuleTypeLogSettings.from_dict(obj["log_settings"]) if obj.get("log_settings") is not None else None, "name": obj.get("name"), "negate_source": obj.get("negate_source") if obj.get("negate_source") is not None else False, - "negate_user": obj.get("negate_user") if obj.get("negate_user") is not None else False, + "negate_user": obj.get("negate_user"), "policy_type": obj.get("policy_type") if obj.get("policy_type") is not None else 'Security', "schedule": obj.get("schedule"), "security_settings": InternetRuleTypeSecuritySettings.from_dict(obj["security_settings"]) if obj.get("security_settings") is not None else None, diff --git a/scm/security_services/models/security_rules.py b/scm/security_services/models/security_rules.py index 6ed15adf..cc719ebf 100644 --- a/scm/security_services/models/security_rules.py +++ b/scm/security_services/models/security_rules.py @@ -58,7 +58,7 @@ class SecurityRules(BaseModel): name: Optional[StrictStr] = Field(default=None, description="The name of the security rule") negate_destination: Optional[StrictBool] = Field(default=False, description="Negate the destination addresses(es)?") negate_source: Optional[StrictBool] = Field(default=False, description="Negate the source address(es)?") - negate_user: Optional[StrictBool] = False + negate_user: Optional[StrictBool] = None policy_type: Optional[StrictStr] = 'Security' profile_setting: Optional[SecurityRuleTypeProfileSetting] = None schedule: Optional[StrictStr] = Field(default=None, description="Schedule in which this rule will be applied") @@ -216,7 +216,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "negate_destination": obj.get("negate_destination") if obj.get("negate_destination") is not None else False, "negate_source": obj.get("negate_source") if obj.get("negate_source") is not None else False, - "negate_user": obj.get("negate_user") if obj.get("negate_user") is not None else False, + "negate_user": obj.get("negate_user"), "policy_type": obj.get("policy_type") if obj.get("policy_type") is not None else 'Security', "profile_setting": SecurityRuleTypeProfileSetting.from_dict(obj["profile_setting"]) if obj.get("profile_setting") is not None else None, "schedule": obj.get("schedule"),